on 11-16-2004 5:11 PM
I know I must be doing something wrong. I wrote a Webservice to to create a sales order in SAP. OK testing outside Tomcat/AXIS it works great. However when I deploy as a webservice the same code causes java.lang.reflect.InvocationTargetException
Has anyone seen this before. With debug prints I see the the failure occurs right at the call to createClient.
mConnection = JCO.createClient(SAPCLIENT,
SAPUSER,
PASSWORD,
LANGUAGE,
APPSERVER,
SYSTEMNUMBER);
I'm using AXIS 1.1 and tomcat provided by java web services development pack 1.3 and JCO 2.0.9
Thanks in advance
Hobert, have you tured on tracing for the JCO classes? If so is there any information in the JCO log file?
The tracing can be set by setting these properties:
JCO.setTraceLevel
JCO.setTracePath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I turned on the tracing but I can't get to that before the error. Seems I can't get to any JCO classes.
I tried outside of the AXIS invironment and got the attached log.
-
SAP Java Connector (JCo) |
Copyright (c) 2000-2002 SAP AG. All rights reserved. |
Version Information |
-
Java Runtime:
Operating System: Windows 2000 5.0 for x86
Java VM: 1.4.1_02 Sun Microsystems Inc.
Java Codepage: Cp1252
Versions:
JCo API: 2.0.9 (2003-07-04)
JCo middleware: 2.0.9 (2003-07-04)
JCo library: 2.0.9 (2003-07-04)
RFC library: 620,0,949
Paths:
JCo classes: C:\Download\JCo\JCo_2.0.9\sapjco.jar
JCo library: C:\Download\JCo\JCo_2.0.9\sapjcorfc.dll
RFC library: System-defined path
-
Manifest |
-
Manifest-Version: 1.0
Implementation-Version: 2.0.9 [20030722 0013]
Specification-Title: SAP Java Connector
Specification-Version: 2.0
Implementation-Title: com.sap.mw.jco
Main-Class: com.sap.mw.jco.About
Created-By: Ant 1.4.1
Implementation-Vendor-Id: com.sap
Implementation-Vendor: SAP AG, Walldorf
Specification-Vendor: SAP AG, Walldorf
-
main [15:01:06:111]: ******************** Tue Nov 16 15:01:06 CST 2004 ***************************
main [15:01:06:541]: [JNI-LAYER] RFC.createRecord("INPUT"(0006F78C),0006F4D4) enter [SUCCESS]
main [15:01:06:541]: [JNI-LAYER] RFC.createRecord("TABLES"(0006F788),0006F5A0) enter [SUCCESS]
main [15:01:06:541]: [JNI-LAYER] RFC.createRecord("RFC_FUNINT"(008B7BF8),0ACDCC38) enter [SUCCESS]
main [15:01:06:541]: [JNI-LAYER] RFC.reallocRecordBuffers("RFC_FUNINT"(00920BEC),0ACDCC38) enter [SUCCESS]
main [15:01:06:802]: [JNI-LAYER] RFC.reallocRecordBuffers("RFC_FUNINT"(00920BEC),0ACDCC38) enter [SUCCESS]
main [15:01:06:812]: [JNI-LAYER] RFC.createRecord("INPUT"(0006F780),0006F4C8) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.createRecord("TABLES"(0006F77C),0006F594) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.createRecord("DFIES"(008B7BFC),0ACDCC38) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.reallocRecordBuffers("DFIES"(00920C14),0ACDCC38) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.createRecord("OUTPUT"(0006F778),0006F3FC) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.createRecord("SBC_TABLEN"(0AC80B04),0AD1F188) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.createRecord("DFIES"(0AC80B40),0AD1F254) enter [SUCCESS]
main [15:01:06:822]: [JNI-LAYER] RFC.createRecord("DDTYPELIST"(0ACA3ECC),0AD1F320) enter [SUCCESS]
main [15:01:06:992]: [JNI-LAYER] RFC.reallocRecordBuffers("OUTPUT"(00920C18),0006F3FC) enter [SUCCESS]
main [15:01:06:992]: [JNI-LAYER] RFC.reallocRecordBuffers("SBC_TABLEN"(00920C1C),0AD1F188) enter [SUCCESS]
main [15:01:06:992]: [JNI-LAYER] RFC.reallocRecordBuffers("DFIES"(0AD03F28),0AD1F254) enter [SUCCESS]
main [15:01:07:002]: [JNI-LAYER] RFC.reallocRecordBuffers("DFIES"(00920C14),0ACDCC38) enter [SUCCESS]
main [15:01:07:002]: [JNI-LAYER] RFC.createRecord("INPUT"(0006F950),0006F698) enter [SUCCESS]
main [15:01:07:002]: [JNI-LAYER] RFC.createRecord("TABLES"(0006F94C),0006F764) enter [SUCCESS]
main [15:01:07:002]: [JNI-LAYER] RFC.createRecord("T100"(008B7C0C),0AD5A3B8) enter [SUCCESS]
main [15:01:07:002]: [JNI-LAYER] RFC.reallocRecordBuffers("T100"(00955764),0AD5A3B8) enter [SUCCESS]
main [15:01:07:002]: [JNI-LAYER] RFC.createRecord("OUTPUT"(0006F948),0006F5CC) enter [SUCCESS]
main [15:01:09:285]: [JNI-LAYER] RFC.reallocRecordBuffers("OUTPUT"(00955768),0006F5CC) enter [SUCCESS]
main [15:01:09:285]: [JNI-LAYER] RFC.reallocRecordBuffers("T100"(00955764),0AD5A3B8) enter [SUCCESS]
Hobert, I am not really sure what the problem is but here are two thoughts.
First, make sure that whatever SDK Tomcat is using has the sapjcorfc.dll in the bin directory (the SDK Tomcat uses is usually specified by the JAVA_HOME environment variable).
Second make sure your axis project running in Tomcat has visibility to the sapjco.jar by placing this jar in either Tomcat_Home/shared/lib or Tomcat_Home/webapps/axis/WEB-INF/lib.
Other than that the only I can think of is some kind of port collion although this wouldn't seem to match the exception type.
Corey
Hi Hobert
This looks to me like the sapjco.jar is not able to link to the sapjco.dll.
What about ordinary web apps running on Tomcat are they able to use the JCO.
Try Coreys way just remeber to place the sapjco.jar and sapjco.dll together or try registering the dll.
There are couple of posts in this forum that faced similar problems
Regards
Pran
Many thanks to Corey and Pran. Your suggestion solved my problem. I never copied SAPJCORFC.DLL from the distribution. Just the LIBRFC32.DLL and SAPJCO.JAR per the install instructions. I have never used Jco in a web application and it always worked fine from my JAVA desktop applications so I thought everything was in place. Apparently Tomcat needs SAPJCORFC.DLL. I copied it to Tomcat's bin and problem solved. It's interesting that this glaring GOTCHA is not documented, but hey I'm not one to argue with success!
Thanks again guys
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.