title: how to access the SAP JCo connector from a Java Web Service?
body: <p>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 "<strong>(102) JCO_ERROR_COMMUNICATION: Connect to SAP gateway failed</strong>", 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 "<strong>hostname.private</strong>" and I can't access to SAP.</p>
  
  <p>JCo Exception:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Web service error:</p>
  
  <pre><code>&lt;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"&gt;
  &lt;soapenv:Body&gt;
    &lt;soapenv:Fault&gt;
       &lt;faultcode&gt;soapenv:Server.userException&lt;/faultcode&gt;
       &lt;faultstring&gt;java.lang.reflect.InvocationTargetException&lt;/faultstring&gt;
       &lt;detail&gt;
          &lt;ns1:hostname xmlns:ns1="http://xml.apache.org/axis/"&gt;servermac.private&lt;/ns1:hostname&gt;
       &lt;/detail&gt;
    &lt;/soapenv:Fault&gt;
  </code></pre>
  
  <p>
  </p>