关于sap:SAP-Java-Connector-错误-JCOERRORCOMMUNICATION

48次阅读

共计 3644 个字符,预计需要花费 10 分钟才能阅读完成。

我运行 SAP Java Connector 自带的 SimpleCall 例子程序时,遇到如下谬误音讯:

Exception in thread “main” com.sap.conn.jco.JCoException: (102) JCO_ERROR_COMMUNICATION: Initialization of repository destination ABAP_AS1 failed: Connect to SAP gateway failed

connection parameters: TYPE=A DESTINATION=ABAP_AS1 ASHOST=abap_host_name SYSNR=00 PCS=1 SERIALIZATION_FORMAT=columnBased NETWORK=LAN

LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR hostname ‘abap_host_name’ unknown
TIME Tue Oct 25 14:07:48 2022
RELEASE 753
COMPONENT NI (network interface)
VERSION 40
RC -2
MODULE D:/depot/bas/753_REL/src/base/ni/ninti.c
LINE 898
DETAIL NiPGetHostByName: ‘abap_host_name’ not found
SYSTEM CALL getaddrinfo
COUNTER 2

at com.sap.conn.jco.rt.RfcDestination.getSystemID(RfcDestination.java:1560)
at com.sap.conn.jco.rt.RepositoryManager.getRepository(RepositoryManager.java:28)
at com.sap.conn.jco.rt.RfcDestination.initRepository(RfcDestination.java:1464)
at com.sap.conn.jco.rt.RfcDestination.getRepository(RfcDestination.java:1846)
at com.sap.conn.jco.rt.RfcDestination.getRepository(RfcDestination.java:40)
at com.sap.conn.jco.examples.client.beginner.SimpleCall.main(SimpleCall.java:23)

Caused by: com.sap.conn.jco.JCoException: (102) JCO_ERROR_COMMUNICATION: Connect to SAP gateway failed

connection parameters: TYPE=A DESTINATION=ABAP_AS1 ASHOST=abap_host_name SYSNR=00 PCS=1 SERIALIZATION_FORMAT=columnBased NETWORK=LAN

LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR hostname ‘abap_host_name’ unknown
TIME Tue Oct 25 14:07:48 2022
RELEASE 753
COMPONENT NI (network interface)
VERSION 40
RC -2
MODULE D:/depot/bas/753_REL/src/base/ni/ninti.c
LINE 898
DETAIL NiPGetHostByName: ‘abap_host_name’ not found
SYSTEM CALL getaddrinfo
COUNTER 2
(remote system is [<unknown>])

at com.sap.conn.jco.rt.AbstractConnection.generateJCoException(AbstractConnection.java:624)
at com.sap.conn.jco.rt.ClientConnection.connectInternal(ClientConnection.java:633)
at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:1201)
at com.sap.conn.jco.rt.RepositoryConnection.connect(RepositoryConnection.java:188)
at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:116)
at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:461)
at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:24)
at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:400)
at com.sap.conn.jco.rt.RfcDestination.getSystemID(RfcDestination.java:1542)
... 5 more

Caused by: RfcException raised by system [<unknown>]:

message: Connect to SAP gateway failed
connection parameters: TYPE=A DESTINATION=ABAP_AS1 ASHOST=abap_host_name SYSNR=00 PCS=1 SERIALIZATION_FORMAT=columnBased NETWORK=LAN

LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR hostname ‘abap_host_name’ unknown
TIME Tue Oct 25 14:07:48 2022
RELEASE 753
COMPONENT NI (network interface)
VERSION 40
RC -2
MODULE D:/depot/bas/753_REL/src/base/ni/ninti.c
LINE 898
DETAIL NiPGetHostByName: ‘abap_host_name’ not found
SYSTEM CALL getaddrinfo
COUNTER 2

return code: RFC_FAILURE (1)
error group: 102
key: RFC_ERROR_COMMUNICATION
at com.sap.conn.rfc.engine.RfcIoControl.error_end(RfcIoControl.java:234)
at com.sap.conn.rfc.engine.RfcIoControl.ab_rfcopen(RfcIoControl.java:125)
at com.sap.conn.rfc.api.RfcApi.RfcOpen(RfcApi.java:77)
at com.sap.conn.jco.rt.ClientConnection.connectInternal(ClientConnection.java:597)
... 12 more

这是因为 JCO 我的项目文件夹下 ABAP_AS1.jcoDestination 文件的 jco.client.ashost 字段,依然应用了默认的 abap_host_name 值 (咱们在谬误音讯里能够察看到这个值)

这里波及到 destination 的概念。

JCoDestination 标识函数调用的物理目的地。它蕴含连贯到 SAP 零碎所需的所有属性。
留神:JCoDestination 只是一个配置实例,其中蕴含 JCo 运行时创立连贯所需的所有信息。它自身不会创立或放弃任何连贯。如果由指标配置定义,JCo 运行时会创立连贯并将它们会集起来。

指标 BACK 仅在 JCo RFC 服务器场景中可用,在发送 RFC 申请的工夫点和返回 RFC 响应的工夫点之间。

Destination 的类型:

  • 3 – 应用未指定登录办法的 ABAP 零碎的目的地
  • A – 应用间接应用程序服务器主机登录的 ABAP 零碎的指标
  • B – 具备音讯服务器驱动的负载平衡登录的 ABAP 零碎的目的地
  • E – 内部 RFC 服务器程序的目的地
  • R – 已注册 RFC 服务器程序的目的地
  • N – SAP Cloud Platform 中应用未指定登录办法的本地 ABAP 零碎的目的地

正文完
 0