cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Running JCO code in Netweaver Devloper Studio

Former Member
0 Kudos

Hi,

I have written a simple java program to get data from SAP using JCO code. It get compiled successfuly but when I run it, It gives the following error :

java.lang.NoClassDefFoundError

at com.sap.mw.jco.MiddlewareJRfc$Client.connect(MiddlewareJRfc.java:798)

at com.sap.mw.jco.JCO$Client.connect(JCO.java:2829)

at com.sap.test.SAPPoDetailMain.getPODetail(SAPPoDetailMain.java:39)

at com.sap.test.SAPPoDetailMain.main(SAPPoDetailMain.java:77)

Exception in thread "main"

Is there any way in which I can run this code in Netweaver Devloper Studio.

Thanks

Naresh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Naresh,

standalone Java apps does not work with the JCO library normally used (declared via Set Additional Libraries for example), since the contained "jrfc.jar" seems now to be restricted for "inside server engine" usage.

Please remove the library usage and use the ECLIPSE_HOME/plugins/com.sap.mw.jco/lib/sapjco.jar instead.

Hope that helps.

Best regards

Stefan

Former Member
0 Kudos

Hi Stefan,

I have tried that but still it is giving the same. I am using Generated proxied to call function module. Once again copying the detailed error :

java.lang.UnsatisfiedLinkError: no CpicNative in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)

at java.lang.Runtime.loadLibrary0(Runtime.java:788)

at java.lang.System.loadLibrary(System.java:834)

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(Class.java:141)

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

at com.sap.test.SAPPoDetailMain.getPODetail(SAPPoDetailMain.java:26)

at com.sap.test.SAPPoDetailMain.main(SAPPoDetailMain.java:79)

java.lang.NoClassDefFoundError

at com.sap.mw.jco.MiddlewareJRfc$Client.connect(MiddlewareJRfc.java:798)

at com.sap.mw.jco.JCO$Client.connect(JCO.java:2829)

at com.sap.test.SAPPoDetailMain.getPODetail(SAPPoDetailMain.java:41)

at com.sap.test.SAPPoDetailMain.main(SAPPoDetailMain.java:79)

Exception in thread "main"

Thanks

Naresh

Former Member
0 Kudos

Hi Naresh,

please assure that there are no references left to "jrfc.jar" in your Java Build Path. You're still using it, since the "no CpicNative..." error is raised by the init-procedure of JRfc.

Best regards

Stefan

Former Member
0 Kudos

Hi Stefan,-

Brilliant. I've found some topics related to this issue - the one of yours is really working.

Thanks.