You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by guerra <jg...@gmail.com> on 2011/07/19 12:55:44 UTC

ActiveMQ 5.4.2 RA fails to connect to a broker.

I came across with a problem what it looks like a ActiveMQ problem, but if
anyone here knows more about it, please feel free to post any thought.

I have two ActiveMQ 5.4.2 RAs deployed on glassfish 3.1. Each RA connects
with two different brokers hosted on 192.168.1.10 and both brokers have a
type of master/slave configuration to failover on 192.168.1.11. The problem
is that I can't get working one of the RAs because the connection fails with
the exception posted below. The funniest part is that the other RA connects
perfectly and thus I can't figure out why one of the brokers works and the
other one doesn't.

Thanks

INFO: 2011-07-19 11:38:54,667 [test-pool; w: 5] ERROR ActiveMQEndpointWorker        
- Failed to connect to broker
[failover:(tcp://192.168.1.10:40000,tcp://192.168.1.11:40000)?randomize=false]:
Could not create Transport. Reason: java.io.IOException: Transport scheme
NOT recognized: [failover]
javax.jms.JMSException: Could not create Transport. Reason:
java.io.IOException: Transport scheme NOT recognized: [failover]
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:245)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
	at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:185)
	at
org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:133)
	at
org.apache.activemq.ra.ActiveMQEndpointWorker$1.run(ActiveMQEndpointWorker.java:106)
	at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114)
	at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
	at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.io.IOException: Transport scheme NOT recognized: [failover]
	at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
	at
org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:204)
	at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:79)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
	... 7 more
Caused by: java.lang.ClassCastException:
org.apache.activemq.transport.failover.FailoverTransportFactory cannot be
cast to org.apache.activemq.transport.TransportFactory
	at
org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:201)
	... 9 more


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-4-2-RA-fails-to-connect-to-a-broker-tp3677852p3677852.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.4.2 RA fails to connect to a broker.

Posted by guerra <jg...@gmail.com>.
Thanks Gary for your feedback. 
Inside of the classloader universe on Glassfish, and AFAIK, the connector
classloader loads individually deployed RAR modules, which are shared
between the applications. So, I think that could be a problem according to
your post because all the classes are shared between applications and likely
it leads onto this problem.
Now, I am not sure how to go ahead because each ActiveMQ RAR embeds the
dependencies. I mean, one scenario I can imagine is taking out the
dependencies and using the applib classloader to share those dependencies to
different deployed RARs as you point out. I am not sure whether this make
any sense to you! Thanks again for your post!

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-4-2-RA-fails-to-connect-to-a-broker-tp3677852p3679720.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ 5.4.2 RA fails to connect to a broker.

Posted by Gary Tully <ga...@gmail.com>.
it looks like there is more than one classloader involved, and classes
cannot be shared between them.
Note the exception:

Caused by: java.lang.ClassCastException:
> org.apache.activemq.transport.failover.FailoverTransportFactory cannot be
> cast to org.apache.activemq.transport.TransportFactory

The base class, org.apache.activemq.transport.TransportFactory needs
to be loaded by the same class classloader that  initiates the
connection.
Either all of the activemq classes must be shared by all RARs or
embedded in the RAR so that it each RAR gets its own copy.

There should be some glassfish options to allow a single RAR to be
shared or the RAR dependencies need to be deployed into the root
context such that they are visible to all RARs.


On 19 July 2011 11:55, guerra <jg...@gmail.com> wrote:
> I came across with a problem what it looks like a ActiveMQ problem, but if
> anyone here knows more about it, please feel free to post any thought.
>
> I have two ActiveMQ 5.4.2 RAs deployed on glassfish 3.1. Each RA connects
> with two different brokers hosted on 192.168.1.10 and both brokers have a
> type of master/slave configuration to failover on 192.168.1.11. The problem
> is that I can't get working one of the RAs because the connection fails with
> the exception posted below. The funniest part is that the other RA connects
> perfectly and thus I can't figure out why one of the brokers works and the
> other one doesn't.
>
> Thanks
>
> INFO: 2011-07-19 11:38:54,667 [test-pool; w: 5] ERROR ActiveMQEndpointWorker
> - Failed to connect to broker
> [failover:(tcp://192.168.1.10:40000,tcp://192.168.1.11:40000)?randomize=false]:
> Could not create Transport. Reason: java.io.IOException: Transport scheme
> NOT recognized: [failover]
> javax.jms.JMSException: Could not create Transport. Reason:
> java.io.IOException: Transport scheme NOT recognized: [failover]
>        at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
>        at
> org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:245)
>        at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
>        at
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:185)
>        at
> org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:133)
>        at
> org.apache.activemq.ra.ActiveMQEndpointWorker$1.run(ActiveMQEndpointWorker.java:106)
>        at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114)
>        at
> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
>        at
> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
> Caused by: java.io.IOException: Transport scheme NOT recognized: [failover]
>        at
> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
>        at
> org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:204)
>        at
> org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:79)
>        at
> org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:243)
>        ... 7 more
> Caused by: java.lang.ClassCastException:
> org.apache.activemq.transport.failover.FailoverTransportFactory cannot be
> cast to org.apache.activemq.transport.TransportFactory
>        at
> org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:201)
>        ... 9 more
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-4-2-RA-fails-to-connect-to-a-broker-tp3677852p3677852.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://fusesource.com
http://blog.garytully.com