QUESTION POSED ON: 11 August 2004
I am trying to create a connection to SAP using the following piece of code:
JCO.Client mConnection = null;
try {
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?
|