Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've a java web service in Eclipse for Mac using the JCo connector to access a number of RFCs, but my java code could not access SAP that had the error "(102) JCO_ERROR_COMMUNICATION: Connect to SAP gateway failed", But I solved it by adding the ip of the server you want access, the file hosts of mac os x. The problem is that when you access this web service is on a Mac Os X server, returns the error "hostname.private" and I can't access to SAP.

JCo Exception:

com.sap.conn.jco.JCoException: 
(102) JCO_ERROR_COMMUNICATION: Connect to SAP gateway failed
Connection parameters: TYPE=A DEST=ABAP_AS ASHOST=192.168.90.5 SYSNR=04 SAPROUTER=/H/192.220.35.89/S/3299 PCS=1

LOCATION    CPIC (TCP/IP) on local host
ERROR       hostname 'servermac.private' unknown
TIME        Mon Jul  4 13:18:36 2011
RELEASE     720
COMPONENT   NI (network interface)
VERSION     40
RC          -2
MODULE      nixxhl.cpp
LINE        183
DETAIL      NiHLGetNodeAddr: hostname cached as unknown
COUNTER     4 here

Web service error:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
  <soapenv:Fault>
     <faultcode>soapenv:Server.userException</faultcode>
     <faultstring>java.lang.reflect.InvocationTargetException</faultstring>
     <detail>
        <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">servermac.private</ns1:hostname>
     </detail>
  </soapenv:Fault>

share|improve this question
1  
Do you have any entries in your hosts file (/etc/hosts) for either 192.168.90.5 or servermac.private? –  Chris Carruthers Jul 5 '11 at 1:16
    
Yes, I attach the sap server ip and mac server name and the java code works perfectly, which would mean that Web services also work, but it does not, gives me the same error. 192.168.90.5 servermac.private ## in the host file –  openyourstackoverflow Jul 5 '11 at 14:24
    
What if you remove the hosts file entry then? –  Chris Carruthers Jul 8 '11 at 0:57
    
Adding the ip with the name of my Mac Server, effectively making the connection, if he can not. The problem is rather that my Web Service is not JCo classes to work very well. Thanks Chris! –  openyourstackoverflow Jul 8 '11 at 16:22

1 Answer 1

up vote 1 down vote accepted

When I edited the hosts file with ip of server to connect, can effectively connect with SAP, however the mistake was having on the WSDL that was not specifically, but rather that my Web Service has been exported to a WAR and use it on a different server could not connect because the library could not find the libsapjco3.jnilib of the JCo therefore gave me the error that my host could not connect.

Then in the section Properties->DeploymentAssembly of the project agrege added sapjco3.jar and externally to project in the lib section, the library libsapjco3.jnilib, which worked well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.