cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create client error with sample SAP JCO code

Former Member
0 Kudos

Hi,

I am encountering the following error when trying to connect to a R/3 system using the WAS 6.40 on my laptop. I have cut and pasted the Example1 code from the SAPJCO into my NetWeaver developer studio IDE.

java.lang.UnsatisfiedLinkError: no CpicNative 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.mw.rfc.api.RfcApi.initializeDLL(RfcApi.java:1285)

at com.sap.mw.rfc.api.RfcApi.<clinit>(RfcApi.java:1299)

at com.sap.mw.jco.MiddlewareJRfc.<clinit>(MiddlewareJRfc.java:228)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at com.sap.mw.jco.JCO.<clinit>(JCO.java:630)

at com.sap.mw.jco.support.JRfcTest.correctProperties(JRfcTest.java:1043)

at com.sap.mw.jco.support.JRfcTest.initCall(JRfcTest.java:1072)

at com.sap.mw.jco.support.JRfcTest.runConnectionTest(JRfcTest.java:735)

at com.sap.mw.jco.support.JRfcTest.main(JRfcTest.java:202)

Cannot create client, error message:

java.lang.NoClassDefFoundError occured:

Message:null

I have a system user defined in R/3 but still this isn't working. I am new to Java so any light you could shed would be greatly appreciated.

Cheers and TIA,

Rich

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Hello Richard,

I think you should try to compile the Example1.java first on the command line to lock out any influences by the developer studio. Important is, that the actual Directory (.) is in your CLASSPATH environment variable.

Regards

Gregor

Former Member
0 Kudos

Hmmmm.... thats an interesting approach. I will give it a try.

Former Member
0 Kudos

The unsatisfied link error should be because sapjco.jar cannot link to the sapjco.dll.

I tried to simulate the problem by

1) Opening a java perspective.

2) Create a new 'java' project.

3) Add libraries sapjco.jar from the path <Drive>:\Program Files\SAP\JDT\eclipse\plugins\com.sap.mw.jco\lib

You will see sapjcorfc.dll in this path

4)Add a new class file ,Wrote a sample jco code and executed and it worked..

The key is to have the sapjcorfc.dll in the same directory as sapjco.jar

I hope this helps