4

I have a working connection between my Java application and a SAP server through use of SAP JCO. The problem is that my connection is limited to 1 server. There should be an option available for connecting to a SAP message server that acts like a load balancer.

Does anyone have an idea how this works?

My working Hibersap example:

final SessionManagerConfig sessionManagerConfig = new SessionManagerConfig("");

sessionManagerConfig.setContext(JCoContext.class.getName());
sessionManagerConfig.setProperty(DestinationDataProvider.JCO_ASHOST, "");
sessionManagerConfig.setProperty(DestinationDataProvider.JCO_SYSNR, "");
sessionManagerConfig.setProperty(DestinationDataProvider.JCO_CLIENT, "");
sessionManagerConfig.setProperty(DestinationDataProvider.JCO_USER, "");
sessionManagerConfig.setProperty(DestinationDataProvider.JCO_PASSWD, "");
sessionManagerConfig.setProperty(DestinationDataProvider.JCO_LANG, "");

...

user965220
  • 41
  • 1
  • 4

1 Answers1

7

Instead of JCO_ASHOST and JCO_SYSNR, you have to provide

  • JCO_R3NAME with the system ID of the target system
  • JCO_MSHOST with the message server host name or address
  • JCO_MSSERV with the message server port number
  • JCO_GROUP with the name of the logon group

See this file for a working example using JCo3.

vwegert
  • 18,093
  • 3
  • 33
  • 54
  • Very nice example and it works now. There are however several messages every time a request to SAP is made: sapparam: sapargv(argc, argv) has not been called! sapparam(14): FT_DLL (ref.by FN_DPLCOM) missing. sapparam(14): FT_DLL (ref.by FN_JVM) missing. sapparam(14): FT_DLL (ref.by FN_JVM) missing. sapparam(14): FT_DLL (ref.by FN_LCOM) missing. sapparam(14): FT_DLL (ref.by csi/SAP/csa_lib) missing. sapparam(14): FT_DLL_SHR (ref.by igs/ip/zipper) missing. ... sapparam(1c): No Profile used. sapparam: SAPSYSTEMNAME neither in Profile nor in Commandline – user965220 Nov 29 '13 at 10:54
  • If you provide JCO_MSSERV then JCO_R3NAME will be ignored. You do not have to set both of these properties. Furthermore JCO_MSSERV may also contain the symbolic service name like *sapmsABC* instead of the port number. But directly specifying the port number gives a tiny little bit better performance. – Trixx Dec 27 '16 at 01:16