cancel
Showing results for 
Search instead for 
Did you mean: 

JCoServer.stop() doesn't transition to STOPPED

atemsah-incorta
Explorer
0 Kudos

Hi,

Intermittently when calling stop the server state stays stuck at STOPPING and doesn't transition to STOPPED at all. This causes issues when I try to start it again as the start will not allow it unless the server state is STOPPED

Caused by: com.sap.conn.jco.JCoRuntimeException: (136) JCO_ERROR_ILLEGAL_STATE: JCoServer saps4model.SAPS4 is currently running. Current server state is STOPPING
at com.sap.conn.jco.rt.AbstractServer.start(AbstractServer.java:700)
at com.sap.conn.jco.rt.CPICServer.start(CPICServer.java:31)
at com.incorta.datasource.sap.callback.SapErpCallBackServer.start(SapErpCallBackServer.java:148)

I checked a previously asked question https://answers.sap.com/questions/702031/jcoserver-status-changing-to-stopping-not-stopped-.html but I don't have concurrent access / calls to the stop. I guarantee only one thread calls the stop and it waits for 5 mins before allowing any other thread to do an action on the server.

Are there any clues as to why this would happen? Also how to prevent it/work around it?

Accepted Solutions (0)

Answers (2)

Answers (2)

HAL9000
Product and Topic Expert
Product and Topic Expert

JCoServer.stop() is an asynchronous operation and won't stop a JCoServer immediately. It will first go into STOPPING state which means that the JCoServer won't accept any new RFC requests, but on the other hand also won't interrupt or abort any currently running RFC requests. Once that all running RFC requests have been processed and finished, and all RFC server connections have been closed, it will thereafter go into the STOPPED state.

Only if the JCoServer instance has been fully STOPPED, calling JCoServer.start() will work again.

Always make sure that your own registered function and request handler implementations for the JCoServer instance do not stall, enter an endless loop or go into a deadlock situation, otherwise the consequence is that also the JCoServer cannot stop then.

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

An additional tip for trouble shooting this: when you see that the JCoServer is in state STOPPING for an unusually long time, create a Java Threaddump. Here you might be able to see, whether any of your function handlers has dead-locked.

Sriram2009
Active Contributor
0 Kudos

Hi Tarek

1. Check the Jco trace file error messages

2. Check this sap notes 2530804 and 1804372 it applicable on your enviroement.

Regards

SS