on 06-29-2009 10:06 PM
Hi
I created a JCO IDoc server (using the JCoIDocServer class) , so far it works fine for me to send and receive IDocs to R/3. The only issue is when I try to start and stop the JCO Idoc server at runtime. When I call the Stop method(). It seems like the service is stopped but if i call a Start method after that( even on a completely new class instance) I'm getting a nullpointer exception. I have seen documents on JCOServer says that use suspend method for stop the server, but this is not available for the JCoIDocServer class. How can I stop a server which is running, programaticalluy and restart it again ? (I dont mind if I have to reinstantiate the whole server class) . I use JCO and IDoc libaray version 3.0 . Please help
Thanks
HI I'm having exactly the same problem with JCO 3.01.
When I stop my rfc server (due to network problems etc), rebuild the connection, it produces almost exactly the same error.
4.7.2010::13:32:41:937>>SYSTEM: java.lang.NullPointerException
java.lang.NullPointerException
4.7.2010::13:32:41:937>> at java.util.Hashtable.get(Hashtable.java:334)
4.7.2010::13:32:41:937>> at com.sap.conn.jco.rt.DefaultServerManager.addServer(DefaultServerManager.java:130)
4.7.2010::13:32:41:937>> at com.sap.conn.jco.rt.DefaultServer.addListener(DefaultServer.java:251)
4.7.2010::13:32:41:937>> at com.sap.conn.jco.rt.DefaultServer.start(DefaultServer.java:609)
4.7.2010::13:32:41:937>> at com.sap.conn.jco.rt.DefaultServer.start(DefaultServer.java:596)
Could it be a problem with the Java Connector 3.01?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello!
We are one JCO 3.0.9 and IDOC library 3.0.7.
Since the first JCO 3.x release we are unable to make the restarting of the server work properly.
When we get a network problem, we disconnect via:
server.stop();
and then wait in a loop until server.getState() is JCoServerState.STOPPED.
Then we call:
server.release();
and (to prevent getting NullPointerException as original poster)
StandaloneServerFactory.get().deleted(serverName);
However, when we want to restart the server we first get (9 times in a row with 10seconds between retries - so 90sec total):
com.sap.conn.jco.JCoRuntimeException: (136) JCO_ERROR_ILLEGAL_STATE: JCo server is currently running. Current server state is DEAD
at com.sap.conn.jco.rt.DefaultServer.start(DefaultServer.java:744)
at com.sap.conn.idoc.jco.rt.DefaultJCoIDocServer.start(DefaultJCoIDocServer.java:177)
And interestingly in next retry we get this:
com.sap.conn.jco.JCoRuntimeException: (136) JCO_ERROR_ILLEGAL_STATE: JCo server is currently running. Current server state is ALIVE
at com.sap.conn.jco.rt.DefaultServer.start(DefaultServer.java:744)
at com.sap.conn.idoc.jco.rt.DefaultJCoIDocServer.start(DefaultJCoIDocServer.java:177)
And after this, the server can not be started again (everytime we retry calling server.start() we get error above).
Are we doing something wrong ? What is the correct way to restart the JCO Server (after network problems, etc) ?
Hi,
Try using the abort() after your stop in a "if" condition. You need to provide a message as a parameter for the abort() method, so that the remote SAP System (in case the IDoc Server is still connected to it) knows the reason why the IDoc server shutdown without any warning.
So your code should look something like this (warning pseudo-code ) -
server.stop();
if(server.alive())
{
server.abort("Forcing shutdown because its wakey wakey eggs and beccy time!");
}
Try logging the status of the server after the stop() and abort() methods to know what the server is doing. I hate people using the suspend() method to "stop" the server, because it does not stop the server. It only suspends operations, so your connection and session to the remote SAP System remains open.
After the time out (can be hours) on the remote System, the connection is closed, but until then, the remote SAP System keeps expecting your server to talk back to it. Open sessions are of course more dangerous than runaway trains, so avoid the suspend() method if you can.
T00th
Edited by: Sameer Jagirdar on Jan 21, 2010 1:14 PM --> fixed the code display thingy.
Edited by: Sameer Jagirdar on Jan 21, 2010 1:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dear,
Is it a standalone application?
I am looking for something like that, Could you guide me how to build such tool or if would like to share?
Regards,
Nams
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Dear,
Is it a standalone application?
I am looking for something like that, Could you guide me how to build such tool or if would like to share?
Regards,
Nams
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Experts,
DId I posted this on the right place?? Or do I have to move this to a different forum. Please advice.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the trace if this helps
java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at com.sap.conn.jco.rt.DefaultServerManager.addServer(DefaultServerManager.java:130)
at com.sap.conn.jco.rt.DefaultServer.addListener(DefaultServer.java:251)
at com.sap.conn.jco.rt.DefaultServer.start(DefaultServer.java:609)
at com.sap.conn.jco.rt.DefaultServer.start(DefaultServer.java:596)
at com.sap.conn.idoc.jco.DefaultJCoIDocServer.start(DefaultJCoIDocServer.java:96)
at com.timelink.erp.connectors.Jco.TLSAPJCoServer.JCoTRfcServer(TLSAPJCoServer.java:526)
at com.timelink.erp.connectors.Jco.TLSAPJCoServer.run(TLSAPJCoServer.java:88)
at java.lang.Thread.run(Unknown Source)
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did anyone have an answer for this?? When I stop the server and again do a getserver(dest) , and after try a server start(), I'm getting java nullpointer exception. Although the server instance is seems to be right with all the required parameter values . The same start() call works for the first time(if I start the application from commandline) once I stop() it from code and agin do a start from the code it gives me nullpointerexception. All ideas are welcome.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.