on 02-06-2015 3:02 PM
Hi,
i used the example "StepByStepClient" from JCO3 to connect to a SAP backend directly with this connectProperties:
DestinationDataProvider.JCO_ASHOST,
DestinationDataProvider.JCO_SYSNR,
DestinationDataProvider.JCO_CLIENT,
DestinationDataProvider.JCO_USER,
DestinationDataProvider.JCO_PASSWD,
DestinationDataProvider.JCO_LANG,
every thing works fine.
Now i want to connect to a sap system with load balancing and i try to connect with this connectProperties:
DestinationDataProvider.JCO_R3NAME,
DestinationDataProvider.JCO_SYSNR,
DestinationDataProvider.JCO_MSHOST,
DestinationDataProvider.JCO_MSSERV,
DestinationDataProvider.JCO_GROUP,
DestinationDataProvider.JCO_CLIENT,
DestinationDataProvider.JCO_USER,
DestinationDataProvider.JCO_PASSWD,
DestinationDataProvider.JCO_LANG,
and get this error:
Attributes:
Exception in thread "main" com.sap.conn.jco.JCoException: (102) JCO_ERROR_COMMUNICATION: Connect to message server host failed
Connection parameters:..................................
LOCATION SAProuter 39.3 (SP4) on 'XXXXXX'
ERROR internal error
TIME Fri Feb 6 15:57:20 2015
RELEASE 710
COMPONENT NI (network interface)
VERSION 39
RC -93
MODULE nirout.cpp
LINE 2685
DETAIL NiRClientHandle: route expected
COUNTER 3312453
at com.sap.conn.jco.rt.MiddlewareJavaRfc.generateJCoException(MiddlewareJavaRfc.java:681)
at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1376)
at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:736)
at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:107)
at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:316)
at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:46)
at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:290)
at com.sap.conn.jco.rt.RfcDestination.initialize(RfcDestination.java:873)
at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:551)
at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:33)
at jcoTest.Client.step1Connect(Client.java:142)
at jcoTest.Client.main(Client.java:129)
Caused by: RfcException: [null]
message: Connect to message server host failed
I searched for the problem and found this explanation:
Background and Further Analysis:
The client program sends incorrect data to the SAProuter. This is usually the case if the client assumes that it is already communicating with the target system but the connection was actually established to an SAProuter that has to wait for a route first. Check the parameters for the connection setup on the client.
But how can i fix the Problem?
Thanks, André
Hi Andre,
I do not think that your found explanation is valid here.
For me this looks like your logon parameters and/or your network configuration addresses a SAP Router instead of the SAP Message Server. At least, the error message is coming from a SAP Router which should not be involved at all when looking at your physical connection logon parameters.
Specifying the correct parameters and having a correct network configuration will fix the problem.
But I am afraid that no one is able to guess what's exactly wrong here with that little info. I can only tell you that SYSNR is superfluous and you need either R3NAME or MSSERV but not both - like it is also documented in the JCo JavaDoc for the DestinationDataProvider.
If you have a working SAP GUI with a load balancing configuration I would look up the needed logon parameter values from there.
Best regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
i got a SAPGui Link with this parameter forthe LoadBalanced SAP backend:
SAPgui.exe" /H/XXX.XX.X.XXX/S/3299/M/scscif/S/3605/G/group_name
and translate this to the following JCO connectProperties:
connectProperties.setProperty(DestinationDataProvider.JCO_USER, "USERNAME");
connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "PASSWORD");
connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");
connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "300");
/*
* load balancing connection propertys
*/
connectProperties.setProperty(DestinationDataProvider.JCO_R3NAME, "r3Name");
connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "01");
connectProperties.setProperty(DestinationDataProvider.JCO_MSHOST, "XXX.XX.X.XXX");
connectProperties.setProperty(DestinationDataProvider.JCO_MSSERV, "3299");
connectProperties.setProperty(DestinationDataProvider.JCO_GROUP, "gruppen_name");
I try it with host and serv property to but then i get no connection. With the mshost i get a connection to the ip but with the error you read in my first message.
//connectProperties.setProperty(DestinationDataProvider.JCO_GWHOST , "XXX.XX.X.XXX");
//connectProperties.setProperty(DestinationDataProvider.JCO_GWSERV, "3605");
Do I translate the connection string wrong?
Thanks,
André
Hi Andre,
yes, you do. 😉
As said before you addressed the router instead of the message server.
The correct "translation" should use the following JCo properties:
jco.client.mshost=scscif
jco.client.msserv=3605
jco.client.group=group_name
jco.client.saprouter=/H/XXX.XX.X.XXX/S/3299
As 3299 is the default router port it should also be possible to omit it:
jco.client.saprouter=/H/XXX.XX.X.XXX
SAP Routers should only be used if there is a firewall between JCo and the targeted ABAP system. So I assume that this is the case here. Otherwise you should omit the jco.client.saprouter property completely.
But if you need a SAP Router, you should always specify it separately with the saprouter property.
I hope this helps.
Best regards,
Stefan
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.