cancel
Showing results for 
Search instead for 
Did you mean: 

SAP NetWeaver 7.0 ABAP Trial Version and JCO

Former Member
0 Kudos

hello,

i already installed the SAP NetWeaver 7.0 ABAP Trial Version and now i want to develop a java application in order to connect to the NetWeaver for calling BAPIS etc.

from the JCo package i used the given source code of the example and changed the given parameters to my data.

the exception is like this:

-


com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed

Connect_PM GWHOST=homer:3301, GWSERV=sapgw00, SYSNR=00

LOCATION CPIC (TCP/IP) on local host

ERROR hostname 'homer:3301' unknown

TIME Sat Oct 20 18:35:18 2007

RELEASE 710

COMPONENT NI (network interface)

VERSION 39

RC -2

MODULE ninti.c

LINE 895

DETAIL NiPGetHostByName: 'homer:3300' not found

SYSTEM CALL getaddrinfo

COUNTER 2

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(Unknown Source)

at com.sap.mw.jco.JCO$Client.connect(Unknown Source)

at Sappack.SapConnect.main(SapConnect.java:24)

-


the name of my computer is "homer" i m running windows xp.

Here is the simple little java code:

package Sappack;
import com.sap.mw.jco.*;

public class SapConnect {
	public static void main(String[] args) {
		
		JCO.Client client;
		try
		{
		
			System.out.println("JCO - try part");
			System.out.println(JCO.getMiddlewareVersion());
			client = JCO.createClient("000","bcuser","minisap","de","localhost:3300","00");
			client.connect();
			System.out.println("connected");
			client.disconnect();			
			JCO.Attributes attributes = client.getAttributes();
		      System.out.println("Connection attributes:n" + 
		                         "----------------------n" + attributes);
// Open the connection
client.connect();
		}
		catch(Exception ex)
		{
			ex.printStackTrace();			
		}		
	}
}

i ve anybody has a solution don t hesitate;)

regards

Accepted Solutions (0)

Answers (1)

Answers (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I noticed you have port 3300, I think you should be using 3600 instead. Is the java engine on the same machine as your ABAP engine, if not, then localhost would be invalid as well.

Regards,

Rich Heilman