我项目运行一段时间出现下面错误:
[Log4jUpJMS] 2010-11-16 07:40:18 [ERROR][UpProducer] - JMS Client 生产者发送信息错误:
com.sun.messaging.jms.JMSException: [C4000]: Packet acknowledge failed. user=guest, broker=127.0.0.1:7676(1431)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithAck(ProtocolHandler.java:712)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithAck(ProtocolHandler.java:575)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithReply(ProtocolHandler.java:430)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writeJMSMessage(ProtocolHandler.java:1919)
at com.sun.messaging.jmq.jmsclient.WriteChannel.sendWithFlowControl(WriteChannel.java:154)
at com.sun.messaging.jmq.jmsclient.WriteChannel.writeJMSMessage(WriteChannel.java:107)
at com.sun.messaging.jmq.jmsclient.SessionImpl.writeJMSMessage(SessionImpl.java:770)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:203)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:192)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.send(MessageProducerImpl.java:624)
at com.sun.messaging.jmq.jmsclient.QueueSenderImpl.send(QueueSenderImpl.java:97)
at com.cpc.jms.up.UpProducer.sendMessage(UpProducer.java:118)
at com.ReceiveThread.sendMessageToJMS(ReceiveThread.java:243)
at com.ReceiveThread.run(ReceiveThread.java:159)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[Log4jUpJMS] 2010-11-16 07:40:19 [ERROR][UpProducer] - JMS Client 生产者发送信息错误:
com.sun.messaging.jms.JMSException: [C4001]: Write packet failed. - cause: java.net.SocketException: Socket closed
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSException(ExceptionHandler.java:380)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleException(ExceptionHandler.java:331)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketNoAck(ProtocolHandler.java:413)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithAck(ProtocolHandler.java:617)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithAck(ProtocolHandler.java:575)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketWithReply(ProtocolHandler.java:430)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writeJMSMessage(ProtocolHandler.java:1919)
at com.sun.messaging.jmq.jmsclient.WriteChannel.sendWithFlowControl(WriteChannel.java:154)
at com.sun.messaging.jmq.jmsclient.WriteChannel.writeJMSMessage(WriteChannel.java:107)
at com.sun.messaging.jmq.jmsclient.SessionImpl.writeJMSMessage(SessionImpl.java:770)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:203)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.writeJMSMessage(MessageProducerImpl.java:192)
at com.sun.messaging.jmq.jmsclient.MessageProducerImpl.send(MessageProducerImpl.java:624)
at com.sun.messaging.jmq.jmsclient.QueueSenderImpl.send(QueueSenderImpl.java:97)
at com.cpc.jms.up.UpProducer.sendMessage(UpProducer.java:118)
at com.ReceiveThread.sendMessageToJMS(ReceiveThread.java:243)
at com.ReceiveThread.run(ReceiveThread.java:159)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.sun.messaging.jmq.io.ReadOnlyPacket.writePacket(ReadOnlyPacket.java:456)
at com.sun.messaging.jmq.io.ReadWritePacket.writePacket(ReadWritePacket.java:101)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.writePacketNoAck(ProtocolHandler.java:374)
... 17 more
[Log4jUpJMS] 2010-11-16 07:40:19 [INFO][UpProducer] - 通过JNDI查找 connection factory连接工厂!
[Log4jUpJMS] 2010-11-16 07:40:20 [ERROR][UpProducer] - JMS Client 生产者发送信息错误:
javax.jms.IllegalStateException: [C4059]: Cannot perform operation, session is closed.
at com.sun.messaging.jmq.jmsclient.SessionImpl.checkSessionState(SessionImpl.java:1844)
at com.sun.messaging.jmq.jmsclient.SessionImpl.createObjectMessage(SessionImpl.java:1921)
at com.cpc.jms.up.UpProducer.sendMessage(UpProducer.java:114)
at com.ReceiveThread.sendMessageToJMS(ReceiveThread.java:243)
at com.ReceiveThread.run(ReceiveThread.java:159)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
查询处理方式,收集的建议是(在代码中添加 imqReconnectAttempts=1)属性。我按照修改意见添加上了,再观察段项目的运行情况。
关于处理方式说明见http://192.9.162.102/thread.jspa?threadID=5046107&tstart=76