Question

I am working in a Java EE project that integrates with SAP system, and I am trying to run a simple standalone java class that calls a RFC. My snippet of code is

JCO.Client mConnection =
    JCO.createClient("dummy", // SAP client
             "dummy", // userid
             "dummy", // password
                 "dummy", // language (null for the default language)
                 "dummy", // application server host name
                 "dummy"); // system number

It throws the following exception "JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc" The only library that i have in this moment is sapjco.jar, i have seen in some foruns that i need this two libraries (librfc32.dll , sapjcorfc.dll) to be able to run this code in an standalone application. Is that right ? Where can i get this two libraries ? The last one is to put in the same folder than the sapjco.jar, is that ok to ?

If I can not run this in my local computer I will have to deploy the application every time that I want to test it :(

Was it helpful?

Solution

Depending on which JCo version you use (you didn't state that), you need one or two platform-specific native libraries. They come bundled with the JCo package, along with some installation documentation. If you don't have this, you've got an incomplete and probably illegal package (redistribution is not allowed). Go to http://service.sap.com/connectors and get the valid one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top