Java Console Corba Client Application (Windows) and Ctrl+C throws CORBA.COMM_FAILURE Exception
I have an Java console application (Windows) that I want to shut down gracefuly when user hit Ctrl+C. That's why I use addShutdownHook to call interrupt() on my worker thread.
The problem is that when I am in the middle of corba operation (in my worker thread) and press Ctrl+C then I get an CORBA.COMM_FAILURE Exception. Do you know why is that?
This is the stack trace:
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 203 completed: No
at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
at com.sun.corba.se.开发者_JAVA百科impl.transport.SocketOrChannelConnectionImpl.writeLock(Unknown Source)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.sendCancelRequestWithLock(Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.sendCancelRequestIfFinalFragmentNotSent(Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.endRequest(Unknown Source)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.releaseReply(Unknown Source)
at org.omg.CORBA.portable.ObjectImpl._releaseReply(Unknown Source)
at INVS._PKICMSStub.UpdateDataInput(_PKICMSStub.java:223)
at com.infonotary.invssignature.SignerThread.createDetachedCMS(SignerThread.java:289)
at com.infonotary.invssignature.SignerThread.createDetachedSignature(SignerThread.java:321)
at com.infonotary.invssignature.SignerThread.signFile(SignerThread.java:378)
at com.infonotary.invssignature.SignerThread.signDirectory(SignerThread.java:451)
at com.infonotary.invssignature.SignerThread.run(SignerThread.java:506)
Edit: On the server side the error is:
#1 0x4054c489 in omni::giopStream::CommFailure::_raise
(minor=1096024068,
status=CORBA::COMPLETED_NO, retry=false,
filename=0x405a2259 "giopStream.cc", linenumber=878,
message=0x405a242c "Error in network receive (start of message)",
strand=0x8c879b8) at giopStream.cc:581
#2 0x4054cc8c in omni::giopStream::errorOnReceive (this=0x8c533ec,
rc=-1,
filename=0x405a2259 "giopStream.cc", lineno=878, buf=0x8cba610,
Edit: I hit Ctrl+C on the client console window.
Edit: May be CORBA code is using sleep operations (when send and receive) and when I interupt the working thread it throws exception and that's the result?
If you are in the middle of a CORBA call and you shut down the client, I would expect the server to receive a COMM_FAILURE.
精彩评论