Java Spring Boot: How to implement a JCo3 server with different message server

332 Views Asked by At

​Hi everyone one, On my project, we are developing a spring boot application which is using JCo3. It works fine for calling SAP from JAVA.

Now we are enhancing this application and we want to create a Jco server.

It will have to communicate with 2 different SAP system. Each system have its own message server. We customize each message server with several logon group according to our needs.

So we have created 2 classes to build up 2 Jco server one per system. For server class, we hae base our development upon this blog: https://blogs.sap.com/2017/08/25/sap-jco-server-example/

So we use a ServerDataProvider to use the parameters below

jco.server.connection_count=2

jco.server.progid=JCO_SERVER_SAP

jco.server.repository_map=SID(020)=S4

jco.server.mshost=myslanaddress.com j

co.server.msserv=3601 jco.server.system_id=SID

We have 2 files to specify these parameters one per SAP system The other system wil use a different progid.

When starting our application, everything goes well for the first bean instanciation. As soon we arrived on the other, when trying to create the new Jco server

  • with for instance new progid JCO_SERVER_SAP and with new message server info)
  • with (server = JCoServerFactory.getServer(properties.getProperty(ServerDataProvider.JCO_PROGID)); The Constructor threw this exception; nested exception is com.sap.conn.jco.JCoRuntimeException: (136) JCO_ERROR_ILLEGAL_STATE: JCoServer JCO_SERVER_SAP is currently running. Current server state is STARTED

It is strange because in debug the progId is JCO_SERVER_CAR and not JCO_SERVER_SAP.. I foun this message (https://answers.sap.com/questions/12862862/how-to-implement-a-jco3-server-with-multiple-diffe.html) but I don’t know how to build such solution.

Do you have any clue ?

Thanks in advance for any help.

I tried to create and use

jco.server.repository_map

but it do not work.

0

There are 0 best solutions below