Hello,

I've run into following issue with ActiveMQ 5.5.1 (fuse-10-16) on Glassfish
3.1.2.2, 
two instances running embedded brokers that are connected over network
connector.

During startup of an application I'll get following exception for some of
the MDBs:

[#|2013-05-30T09:14:49.612+0200|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.inbound|_ThreadID=276;_ThreadName=Thread-2;|

RAR7004 : MDB deployment is still happening. Cannot create end point now.

|#]

[#|2013-05-30T09:14:49.596+0200|SEVERE|glassfish3.1.2|org.apache.activemq.ra.ActiveMQEndpointWorker|
_ThreadID=411;_ThreadName=Thread-2;|

Connection to broker failed: Endpoint factory did not allow creation of any
endpoints.
javax.jms.JMSException: Endpoint factory did not allow creation of any
endpoints.
        at
org.apache.activemq.ra.ServerSessionPoolImpl.getServerSession(ServerSessionPoolImpl.java:123)
        at
org.apache.activemq.ActiveMQConnectionConsumer.dispatch(ActiveMQConnectionConsumer.java:129)
        at
org.apache.activemq.ActiveMQConnection$2.processMessageDispatch(ActiveMQConnection.java:1756)
        at
org.apache.activemq.command.MessageDispatch.visit(MessageDispatch.java:109)
        at
org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1737)
        at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
        at
org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
        at
org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:233)
        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.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
|#]

So far so good - Glassfish will not allow any endpoints to be activated
while deployment is in progress.
It tries to wait 60 seconds, and if the deployment is still running, it will
fail with UnavailableException
(Application's startup time is around 3 minutes). But some time later, I'll
get this:

[#|2013-05-30T09:14:49.737+0200|WARNING|glassfish3.1.2|org.apache.activemq.broker.TransportConnection|
_ThreadID=265;_ThreadName=Thread-2;|

Failed to add Connection ID:S030A1193-60183-1369897804974-313:1, reason: 
javax.jms.InvalidClientIDException: Broker: iconQR1 - Client: XXXX already
connected from vm://QR1#154
|#]

[#|2013-05-30T09:14:49.737+0200|FINE|glassfish3.1.2|org.apache.activemq.ra.ActiveMQEndpointWorker|
_ThreadID=296;_ThreadName=Thread-2;ClassName=org.apache.activemq.ra.ActiveMQEndpointWorker$1;MethodName=run;|
Failed to connect: Broker: iconQR1 - Client: XXXX already connected from
vm://QR1#154
javax.jms.InvalidClientIDException: Broker: QR1 - Client: XXXX already
connected from vm://QR1#154
        at
org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:230)
        at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
        at
org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:81)
        at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
        at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
        at
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
        at
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:715)
        at
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
        at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
        at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:150)
        at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
        at
org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
        at
org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:233)
        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.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
|#]

These two entries likely do not correlate to the same MDB, but these are the
only two kinds of exceptions
I get during startup. The affected subscription is not always the same.

My understanding of this situation is, that a new endpoint is deployed, and
since it is already an existing
subscription with pending messages, ActiveMQ RA will try to deliver the
message. It will fail, because 
deployment is not yet finished, worker closes the consumer and connection,
but broker will not get or 
process remove connection message. Therefore, when ActiveMQEndpointWorker
tries to connect again,
the ClientID is already taken (although the connection is already used for
different purpose, or idle). 
This situation will not resolve, the old connection will not get removed by
itself.

Is there a way to correct this behaviour?

My connection factory uses attribute jms.watchTopicAdvisories=false,
otherwise there were issues with
replying to temp queues from remote broker.

Thanks in advance



-----
---
Patrik Dudits
--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Endpoint-factory-ClientID-problems-during-deployment-on-Glassfish-tp4667751.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to