04-14-2010 4:42 AM
used JCo 3.0.5 to get connection from java to sap.I write a client
program named MyConnect01.java. In the command cmd (Windows XP sp2 32bit),
javac MyConnect01.java, I got the file MyConnect01.class without any exception.
but when I use command java MyConnect01 to execute , there come the exception
like this:
java.lang.UnsatisfiedLinkError: E:\JCo\sapjco3-NTintel-3.0.5\sapjco3.dll:
由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:441)
at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:307)
at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:969)
at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:955)
at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:43)
at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:261)
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:200)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:73)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sap.conn.jco.JCo.createJCo(JCo.java:52)
at com.sap.conn.jco.JCo.<clinit>(JCo.java:26)
at com.sap.conn.jco.JCoDestinationManager.getDestination(JCoDestinationManager.java:61)
at MyConnect01.connectDirect(MyConnect01.java:50)
at MyConnect01.main(MyConnect01.java:224)
Exception in thread "main" java.lang.ExceptionInInitializerError: Error getting the version
of the native layer: java.lang.UnsatisfiedLinkError: E:\JCo\sapjco3-NTintel-3.0.5\sapjco3.dll:
由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:212)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:73)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sap.conn.jco.JCo.createJCo(JCo.java:52)
at com.sap.conn.jco.JCo.<clinit>(JCo.java:26)
at com.sap.conn.jco.JCoDestinationManager.getDestination(JCoDestinationManager.java:61)
at MyConnect01.connectDirect(MyConnect01.java:50)
at MyConnect01.main(MyConnect01.java:224)
The Chinese words there means like this .(Beacause of the Exception of the configuration of the
application, the application can not startup. Reinstallation may fit the problem)
what is the matter? how can i fit it ?
here is my configuration:
windows sp2 32bit
jdk 1.5, and i config the Path ,java_home,classpath parameters ,and i can run javac java commands
in cmd,that means jdk right.
sapjco3-NTintel-3.0.5. I download it from service.sap.com/connectors, I unzip if to E:\JCo\sapjco3-
NTintel-3.0.5 dir.under the folder there are :sapjco3.dll,sapjco3.jar,Readme.txt files and javadoc,
examples subfolders. then I config it as the html:E:\JCo\sapjco3-NTintel-3.0.5\javadoc\installation.html.
To install JCo for Windows unzip the appropriate distribution package into an arbitrary directory
{sapjco3-install-path}.
Then add {sapjco3-install-path} to the PATH environment variable.
Finally, add {sapjco3-install-path}\sapjco3.jar to your CLASSPATH environment variable.
E:\JCo\sapjco3-NTintel-3.0.5 in the Path
E:\JCo\sapjco3-NTintel-3.0.5\sapjco3.jar in the CLASSPATH.
help me !
thank you ,guys
Edited by: yang lei on Apr 14, 2010 5:48 AM
04-14-2010 9:23 AM
Hi Yang,
Please refer to below documents
[SAP JCO|http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5c6a85b11d6b28500508b5d5211/content.htm]
[JCo Exceptions |http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm ]
Hope it helps
Regards
Arun
07-07-2010 8:29 AM
Hi Yang,
this error message means that you still need to install the latest Microsoft C++ 2005 runtime against which the JCo native library is compiled. You can get the from http://www.microsoft.com/technet/security/bulletin/MS09-035.mspx (under Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB973544)).
Best regards,
Markus