cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Start Connection.

Former Member
0 Kudos

Hello i'm getting my first steps with jco and i have a problem connecting.

This is the part of the code I use to connect:

Properties jcoPropeties = new Properties();

jcoPropeties.setProperty("jco.client.client", "400");

jcoPropeties.setProperty("jco.client.user", "USER");

jcoPropeties.setProperty("jco.client.passwd", "PASSWORD");

jcoPropeties.setProperty("jco.client.lang", "ES");

jcoPropeties.setProperty("jco.client.ashost", "Server internal IP 192.168.0.12");

jcoPropeties.setProperty("jco.client.sysnr","00");

jcoPropeties.setProperty("jco.client.gwhost", "Internet ip 80.34.34.34");

jcoPropeties.setProperty("jco.client.gwserv","");

mConnection = JCO.createClient(jcoPropeties);

mConnection.connect();

com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed Connect_PM TYPE=A ASHOST=192.168.0.12 SYSNR=00 GWHOST=80.34.34.34 GWSERV=sapgw00 PCS=1 LOCATION CPIC (TCP/IP) on local host with Unicode ERROR partner not reached (host 80.34.34.34, service sapgw00) TIME Thu Mar 08 20:30:22 2007 RELEASE 640 COMPONENT NI (network interface) VERSION 37 RC -10 MODULE nixxi_r.cpp LINE 8588 DETAIL NiPConnect2 SYSTEM CALL SiPeekPendConn ERRNO 10060 ERRNO TEXT WSAETIMEDOUT: Connection timed out COUNTER 1

can anyone tell me if i'm setting correctly the parameters or where it's the problem? as I undestood I have a timeout and nothing else to debug this code and i'm getting crazy donno if the code is is wrong or i have some kind of restriction of the system administrator to access the system, the thing is that I have also sapgui 6.40 running on the system and i'm able to conect without a problem.

Thanks

jromero@dunasoft.es

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

ok the problem is that JCo Try to connect to port 3300 if you define: jcoPropeties.setProperty("jco.client.gwserv",""); and that was not opened in the company firewall.

SapGui connects over 3299 so you might think the conection its ok but is not.

Best regards and thanks. you helped me a lot

Former Member
0 Kudos

I believe your problem at this stage is related to network issue, your stack trace is trying to suggest you

RELEASE 640 COMPONENT NI (network interface) VERSION 37 RC -10 MODULE nixxi_r.cpp LINE 8588 DETAIL NiPConnect2 SYSTEM CALL SiPeekPendConn ERRNO 10060 ERRNO TEXT WSAETIMEDOUT:

<b>Connection timed out COUNTER 1</b>

I dont think SAPGUI plays any role in this connectivity. Jco requires the JAR files and operating system specific shared libraries i.e. .dlls in case of Windows.

Are you sure you dont have any kind of connection problems between the two end points.

Former Member
0 Kudos

Hej, i saw that configuration example at SAP Help pages the problem is that i'm developing outside the office network on that way i need to connect to it from outside. So i need to provide:

Internet IP of the company

Internal IP of SAP server in the private network.

That's why i'm using another overload function of createClient

JCO.createClient(String client, String user, String passwd, String lang, String ashost, String sysnr, String gwhost, String gwserv)

It's my first conection a sap in this way so i would like to know if i'm doing fine here or i missunderstood this function overload.

Another question i will like to know it's if JCo Connects throw SAPGUI like some old SAP conectors or directly to the sap server. because i'm assuming the conection is direct to SAP servers not throw sapgui.

Former Member
0 Kudos

Hi Jose,

Try the following code.

JCO.Client client = null;

// Create a client connection to a dedicated R/3 system

client = JCO.createClient( "000", // SAP client

"johndoe", // userid

"*****", // password

"EN", // language

"appserver", // host name

"00" ); // system number

// Open the connection

client.connect();

Regards

George