cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Connect Exception for connecting to ABAP system

former_member192818
Active Participant
0 Kudos

Hey Guys,

When running the program

[code]import com.sap.mw.jco.*;

public class TutorialConnect1 extends Object {

JCO.Client mConnection;

public Connect1() {

try {

// Change the logon information to your own system/user

mConnection =

JCO.createClient("100", // SAP client

"RFCUSER2"// userid

"RFCUSER2", // password

null, // language

"LABR3", // application server host name

"00"); // system number

mConnection.connect();

System.out.println(mConnection.getAttributes());

mConnection.disconnect();

}

catch (Exception ex) {

ex.printStackTrace();

System.exit(1);

}

}

public static void main (String args[]) {

Connect1 app = new Connect1();

}

}

[/code]

I get the exception

[code]java.lang.NoClassDefFoundError

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

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

at com.ids.jco.JCOUtil.getClient(JCOUtil.java:37)

at com.ids.jco.JCOUtil.main(JCOUtil.java:23)[/code]

My program in the developer studio compiles just fine, I have added all the libraries in the developer studio. In the "set additional libraries" context menu of the project I have included all the libraries.

In the Debug/Run settings I see all the libraries included when I test the program.

I am running the program on Netweaver Developer Studio SP15

Any help is appreciated.

Regards

Sumit.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please add the following jar to the classpath

<Drive>:/usr/sap/<SID>/JC00/j2ee/cluster/server0/bin/ext/com.sap.mw.jco/jrfc.jar

Hope that helps.

Regards,

S.Divakar

former_member192818
Active Participant
0 Kudos

Thanks Divakar,

Sumit.

Answers (1)

Answers (1)

kishorg
Advisor
Advisor
0 Kudos

Hi Sumit,

the exact problem is discussed in this forum..just check this....

let me know...

Regards

Kishor Gopinathan

former_member192818
Active Participant
0 Kudos

Thanks Kishore.

Regards