Partner not reached error in JCO.destination

2019-06-10 19:05发布

问题:

I'm Having a problem establishing a connection to SAP in my java program. I'm following the examples that come in the JCO download but i always get this error:

    com.sap.conn.jco.JCoException: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connection parameters: TYPE=A DEST=ABAP_AS_WITHOUT_POOL ASHOST=xx.xx.x.xx SYSNR=00 PCS=1

    LOCATION    CPIC (TCP/IP) on local host with Unicode
    ERROR       partner 'xx.xx.x.xx:3300' not reached

    TIME        Wed Jul 08 08:18:28 2015
    RELEASE     711
    COMPONENT   NI (network interface)
    VERSION     39
    RC          -10
    MODULE      nixxi.cpp
    LINE        3147
    DETAIL      NiPConnect2: xx.xx.x.xx:3300
    SYSTEM CALL connect
    ERRNO       10060
    ERRNO TEXT  WSAETIMEDOUT: Connection timed out
    COUNTER     2

I don't know what it can be, i'm writing down the correct connection properties (ashost,user,passwd,sysnr,etc). Has anybody else has had a problem like this?

This is my connection code:

    Properties connectProperties = new Properties();
    connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "xx.xx.x.xx");
    connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR,  "00");
    connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "020");
    connectProperties.setProperty(DestinationDataProvider.JCO_USER,   "xxxxxx");
    connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "xxxxxxx");
    connectProperties.setProperty(DestinationDataProvider.JCO_LANG,   "en");
    createDataFile(ABAP_AS, "jcoDestination", connectProperties);

After that i just instantiate the object with those properties and call the method connect that is written like this:

    JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);
    System.out.println("Attributes:");
    System.out.println(destination.getAttributes());
    System.out.println();

I'm working on Java, using netbeans, the sapjco3.jar is added to my libraries. Do i have to do anything with the dll file that comes?

标签: java sap jco