Requires Free Membership to View
When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.
Hannah Smalltree, Editorial Directortry {
mConnection = JCO.createClient(this.client, // SAP
client
this.userName.toUpperCase(), // userid
this.password.toUpperCase(), // password
this.language.toUpperCase(), // language
this.hostName, // application server host name
this.system); // system number
mConnection.connect();
}catch (JCO.Exception jex) {
throw new Exception(jex.getMessage());
}catch(Exception ex){
throw new Exception("Exception occured while creating Connection to SAP.");
}
In Windows, I am able to connect to SAP system but when I execute the same in Linux environment I get the following exception:
"Exception in thread main java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' default_cpc_mode"
I am using JDK 1.4.2 / RedHat Linux 8.0 / sapjco-linuxintel-2.1.2.
Where am I going wrong?
See my tip on deciphering JCO exceptions. In your case, make sure the environment variable LD_LIBRARY_PATH points to the directory where JCO was installed.
This was first published in August 2004