我有一个Java控制台应用程序(Windows),当用户按Ctrl + C时,我想要优雅地关闭它。这就是我使用addShutdownHook在我的工作线程上调用interrupt()的原因。
问题是,当我在corba操作中(在我的工作线程中)并按Ctrl + C然后我得到一个CORBA.COMM_FAILURE异常。你知道为什么吗?
这是堆栈跟踪:
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.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)
编辑:在服务器端,错误是:
#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,
编辑:我在客户端控制台窗口中按Ctrl + C.
编辑:可能是CORBA代码正在使用睡眠操作(发送和接收时),当我中断工作线程时,它会抛出异常并且结果是什么?
答案 0 :(得分:1)
如果您正在进行CORBA调用并关闭客户端,我希望服务器能够收到COMM_FAILURE。