on 09-16-2009 1:10 PM
Hi All
i am getting following error when i am trying to test sample sapjco 3 tutorial stepbystepclient.java.
i have already added sapjco3.jar as external jars as well as in the the project folder as internal jars.
*java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path*
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
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:425
)
at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntim
e.java:293)
at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:891)
at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:948)
at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:
41)
at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:253)
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:195)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.sap.conn.jco.JCo.createJCo(JCo.java:51)
at com.sap.conn.jco.JCo.<clinit>(JCo.java:25)
at com.sap.conn.jco.JCoDestinationManager.getDestination(JCoDestinationManager.
java:61)
at src.sampleJCO.step1Connect(sampleJCO.java:84)
at src.sampleJCO.main(sampleJCO.java:314)
Exception in thread "main" java.lang.ExceptionInInitializerError: Error getting
the version of the native layer: java.lang.UnsatisfiedLinkError: com.sap.conn.rf
c.driver.CpicDriver.nativeCpicGetVersion([I)I
at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:207)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.sap.conn.jco.JCo.createJCo(JCo.java:51)
at com.sap.conn.jco.JCo.<clinit>(JCo.java:25)
at com.sap.conn.jco.JCoDestinationManager.getDestination(JCoDestinationManager.
java:61)
at src.sampleJCO.step1Connect(sampleJCO.java:84)
at src.sampleJCO.main(sampleJCO.java:314)
I am quite new to java development in SAP.Is it ok to have commonly used application being developed using SAPJCO?
Regards
Shankar
Edited by: Shankar on Sep 16, 2009 5:40 PM
As others have noted, this crops up in Google search, so I thought I would add my issues and resolution to try to assist others.
The sapjco3.jar file needs to be added to your project as a Referenced Library Dependency in order to use its functionality. On Windows, this .jar file is dependent on the sapjco3.dll file that is delivered with it. The exceptions above come from an inability to locate the .dll file. In addition, the .jar file is dependent on having the correct version of the .dll (which means installing it on the system library path could cause compatability issues for those with multiple versions of JCo active).
If you download the most recent JCo package and use it in your projects, I believe the .dll and the .jar are delivered in the same directory, which probably eliminates this issue. In my case, I have an older project that was not set up that way, and I didn't want to risk the regressions that could come from introducing a new code base to the solution. Here's what I did in Eclipse (I am using Mars)
This resolved my problem, and should resolve any problems related to a missing .dll in your Eclipse projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This thread is ancient but it crops up in all google searches so I thought I would post a solution anyway.
I had exactly the same problem and tried all of the above without success. The solution in my case was to make sure the JVM and sapjco3.dll were the for the same platform. I had the 64 bit JCO3 running with 32 bit JVM. I changed and installed the 32 bit JCO3 version.
Go to Start>Control Panel>Java to check JVM version.
If that doesn't work try these:
1. JCO 3 problems with Library - UnsatisfiedLinkError [SOLVED] - Toolbox for IT Groups
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shankar,
Have you dealed with your problems,I can use java throw jco connect to sap rfc,but when i use jsp call the object's method , then report erro as following:
java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
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:421)
at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:290)
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:73)
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)
at omec.com.sap.tools.ERPConnection.<init>(ERPConnection.java:26)
at omec.com.sap.tools.ERPImpStruct.ConnectERP(ERPImpStruct.java:69)
at omec.com.servlet.ScancodeServlet.doPost(ScancodeServlet.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Unknown Source)
Attributes:
Attributes:
2013-1-4 10:46:21 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet ScanServlet threw exception
java.lang.NoClassDefFoundError: com.sap.conn.rfc.driver.CpicDriver
at com.sap.conn.rfc.engine.DefaultRfcRuntime.createChannel(DefaultRfcRuntime.java:52)
at com.sap.conn.rfc.engine.RfcIoOpenCntl.open_channel(RfcIoOpenCntl.java:1260)
at com.sap.conn.rfc.engine.RfcIoControl.ab_rfcopen(RfcIoControl.java:85)
at com.sap.conn.rfc.api.RfcApi.RfcOpen(RfcApi.java:83)
at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1107)
at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:659)
at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103)
at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:171)
at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:44)
at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:160)
at com.sap.conn.jco.rt.RfcDestination.initialize(RfcDestination.java:754)
at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:615)
at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:26)
at omec.com.sap.tools.ERPConnection.<init>(ERPConnection.java:30)
at omec.com.sap.tools.ERPImpStruct.ConnectERP(ERPImpStruct.java:69)
at omec.com.servlet.ScancodeServlet.doPost(ScancodeServlet.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Unknown Source)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or check this link: [SAP note 684106|https://service.sap.com/sap/support/notes/684106]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this [link|http://sap.ittoolbox.com/groups/technical-functional/sap-interfaces/jco-3-problems-with-library-unsatisfiedlinkerror-3229226] - it mentions that Microsoft VC++ Redistributable needs to be updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shankar,
This will be mostly the rfc.dll need to placed with the new one downloaded from the service market place.
Please follow these steps given in the link
Also make sure you use the correct JDK version
Regards,
Vivek Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek
i am kind of new to java development here.I will tell you what i am doing.
1>I have downloaded sapjco3.jar from service market place.
2>i have added this as an external jar in the project,i also added it in the project,to avoid any kind of error.
i am using remote SAP WAS.Do i need to make any installation?If yes then please detail
Thanks and regards
Shankar
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.