Skip to Content
0
Former Member
Nov 16, 2008 at 07:56 PM

SAP JCO 3 UnsatisfiedLinkError: /Library/Java/Extensions/libsapjco3.jnilib:

1668 Views

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