Skip to Content
avatar image
Former Member

Jco SAP Connection Error. Please Help

Hello

I'm a newbie and I'm trying to connect to SAP with this simple application I took from SAP help but I got an error message. Below is the code. At the bottom is the error message I get. It seems like the public Connect1 is not a type or must be decleared first.I tried doing that but the problem still persist.Could any body show me how to get ride of this problem? Thank you all.

import com.sap.mw.jco.*;

public class JcoTest {

JCO.Client mConnection;

public Connect1() {

try{

mConnection = JCO.createClient("300",//SAP Cleint

"<Test>",//userid

"test2",//password

"EN",//language

"<sap6>",//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();

}

}

ERROR MESSAGE STARTS HERE:

java.lang.Error: Unresolved compilation problems:

Connect1 cannot be resolved or is not a type

Connect1 cannot be resolved or is not a type

at JcoTest.main(JcoTest.java:40)

Exception in thread "main"

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Feb 24, 2005 at 07:32 PM

    I have fixed that. The new code looks like this:

    import com.sap.mw.jco.*;

    public class TutorialConnect1 {

    JCO.Client mConnection;

    public TutorialConnect1() {

    try{

    mConnection = JCO.createClient("300",//SAP Cleint

    "<Test>",//userid

    "test2",//password

    "EN",//language

    "<sap6>",//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[]) {

    TutorialConnect1 app = new TutorialConnect1();

    }

    }

    Thank you all.

    BUT NOW I GOT THE FOLLOWING ERRORS. ANY HELP WILL BE HIGHLY APPRECIATED.

    java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [C:\j2sdk1.4.2_06\jre\lib\ext\sapjcorfc.dll: Can't find dependent libraries]. java.library.path [C:\j2sdk1.4.2_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\j2sdk1.4.2_06\bin;C:\sapjco;C:\oracle\ora92\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem]

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

    at TutorialConnect1.<init>(TutorialConnect1.java:28)

    at TutorialConnect1.main(TutorialConnect1.java:40)

    Exception in thread "main"

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Vasanthakumar,

      i'm refering to the java proxies client. the side of the server i understand and made it works, but the java client proxies not yet.

      do you have some information or tutorial to do some example of java proxies as client.

      thnaks