我的应用程序关闭很好,但JVM永远不会退出。我注意到所有线程都显示为STATE = BLOCKED。 ActiveMQ故障转移协议可能无限期地阻塞,但是线程转储似乎根本没有表明。另一个异常值是一个看似来自处于IN_NATIVE状态的CA Wiley工具(Introscope)的线程。
任何可能导致此行为的想法?
答案 0 :(得分:1)
以下是相关的堆栈跟踪:
java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,byte [], int,int,int)@ bci = 0(解释框架) - java.net.SocketInputStream.read(byte [],int,int,int)@ bci = 87,line = 152(解释框架) - java.net.SocketInputStream.read(byte [],int,int)@ bci = 11,line = 122(解释框架) - com.wily.util.io.NonSyncBufferedInputStream.fill()@ bci = 14,line = 54(解释框架) - com.wily.util.io.NonSyncBufferedInputStream.read()@ bci = 12,line = 79(编译帧) - java.io.FilterInputStream.read()@ bci = 4,line = 83(编译帧) - com.wily.util.io.EncryptInputStream.read()@ bci = 1,line = 64(编译帧) - com.wily.org.apache.commons.io.input.ProxyInputStream.read()@ bci = 4,line = 49(编译帧) - com.wily.org.apache.commons.io.input.CountingInputStream.read()@ bci = 1,line = 70(编译帧) - java.io.DataInputStream.readInt()@ bci = 4,line = 387(解释框架) - com.wily.isengard.postofficehub.link.v1.IsengardObjectInputStream.readInt() @ bci = 4,line = 1295(解释框) - com.wily.isengard.postofficehub.link.v1.IsengardObjectInputStream.setUpStartObjectGraph() @ bci = 5,line = 460(解释框) - com.wily.isengard.postofficehub.link.v1.IsengardObjectInputStream.readObject() @ bci = 8,line = 258(解释框) - com.wily.isengard.postofficehub.link.v1.IncomingMessageDeliveryTask.deliverNextMessage(boolean) @ bci = 54,line = 76(解释框) - com.wily.isengard.postofficehub.link.v1.IncomingRouteConnector.receiveIncomingMessages(com.wily.isengard.postofficehub.link.v1.IsengardObjectInputStream) @ bci = 18,line = 170(解释框) - com.wily.isengard.postofficehub.link.v1.IncomingRouteConnector.doTask() @ bci = 32,line = 89(解释框) - com.wily.isengard.util.thread.AThreadedExecutable.run()@ bci = 27,line = 192(解释框架)
socketRead0调用在本机代码中阻止了io。在读取一个字节之前它不会返回,或者如果设置了套接字读取超时,它将超时。它不能被打断。如果您对Socket的创建有任何控制权,则set the timeout非常重要。