on 11-16-2008 7:56 PM
Hi i'm building an app using Sap JCo 3 migrating from 2.1.8. I imported the example apps and had problems in eclipse running it. So i dropped the process all together because of past frustrations with jco i didn't have the time or patience. A month or so later I'm trying again, but this time i packaged my app in a jar then ran java -cp /Library/Java/Extensions/sapjco.jar:myapp.jar StepByStepClient.java and it worked from the command line.
I was inspired again. However I wrote a junit test and I still get the same problem (java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path) when running inside eclipse. Despite it being listed in my classpath in eclipse. In fact when i try to add the external jar it fails because its already listed. The native library is in the same folder as sapjco3.jar.
So i went into project properties, libraries and under JRE System Library, i saw a Native Library Location and edited it to add /Library/Java/Extensions and tried to run it again. Now I have different error:
java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/libsapjco3.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:423)
at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:292)
at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:862)
at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:947)
at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:41)
at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:213)
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:186)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:77)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at com.sap.conn.jco.rt.RuntimeEnvironment.setDestinationDataProvider(RuntimeEnvironment.java:117)
at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:174)......
Any advice would be appreciated.
Thanks in advance.
Joe
Hello,
looks like the JVM cannot find the native library used (sapjco3.dll on windows), put this one on the java.library.path
regards franz
close thread if message is answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. I should have pointed out that I'm running mac os x 10.5.5.
And I have in /Library/Java/Extensions/ (which is in java.library.path)
libsapjco3.jnilib sapjco3.jar
Also, when i run it from the command line it works fine, however when running from eclipse it fails. So i guess more specifically this is a question on using Eclipse with JCO3 on Mac.
Thanks again,
Joe
User | Count |
---|---|
70 | |
26 | |
9 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.