Diego D Diego D - 1 month ago 10
Java Question

Erratic javax.jms.JMSException: Peer disposed

I have a erratic problem with Java JMS.
For moments works fine, but throws the following exception erratically and cut the execution.

It is important to note that this occurs without stopping the broker.

javax.jms.JMSException: Peer (vm://test#1) disposed.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
at org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1773)
at org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1790)
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:99)
at org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:114)
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:99)
at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:203)
at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
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: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://test#1) disposed.

Answer

I think it could be this issue with ActiveMQ: https://issues.apache.org/jira/browse/AMQ-2902

This issue tracker thread says that it is harmless (it is just a noisy INFO level log message), and that it is fixed in ActiveMQ 5.4.2.

On the other hand, you say that the exception "cut the execution" ... which could mean that this is a different issue to yours ...

UPDATE

Anyone getting a "peer disposed" exception that isn't fixed by upgrading ActiveMQ, and isn't related to shutdown (see Unable to shutdown embedded activeMQ service using the built in BrokerService.stop call) should consider lodging a bug report.

Comments