Skip to main content

GF 3.1 ActiveMQ Resource Adapter - TransportFactory ClassCastException

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2013-06-04

Hello, I have GF on linux server. It has 2 connections on remotes ActiveMQ servers (ActiveMQ 5.7.0).

I deployed the ActiveMQ RARs like this :
* I deployed 1 rar with this name activemq-rar-fb and an resource adapter config named activemq-rar-fb (with the property ServerURL=tcp://ipOfFb:61616)
* I deployed 1 rar with this name activemq-rar-fus and an resource adapter config named activemq-rar-fus (with the property ServerURL=tcp://ipOfFus:61616)
* I defined all parameters properly (connection pools, factories, queues, ...)

I deployed my EAR with NO jar like activemq-core.jar. My EAR application work well, it can receive and send messages on both servers. The EJB project inner this EAR has a glassfish-ejb-jar.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-ejb-jar PUBLIC "-// GlassFish Application Server 3.1 EJB 3.1//EN" "">

But when I restart the Glassfish server, I have this errors every 5 seconds:
ERROR ActiveMQEndpointWorker - Failed to connect to broker [tcp://xxx:61616]: Could not create Transport. Reason: Transport scheme NOT recognized: [tcp]
javax.jms.JMSException: Could not create Transport. Reason: Transport scheme NOT recognized: [tcp]
at org.apache.activemq.util.JMSExceptionSupport.create(
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(
at org.apache.activemq.ActiveMQConnectionFactory.createConnection(
at org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(
at org.apache.activemq.ra.ActiveMQEndpointWorker$
Caused by: Transport scheme NOT recognized: [tcp]
at org.apache.activemq.util.IOExceptionSupport.create(
at org.apache.activemq.transport.TransportFactory.findTransportFactory(
at org.apache.activemq.transport.TransportFactory.connect(
at org.apache.activemq.ActiveMQConnectionFactory.createTransport(
... 7 more
Caused by: java.lang.ClassCastException: org.apache.activemq.transport.tcp.TcpTransportFactory cannot be cast to org.apache.activemq.transport.TransportFactory
at org.apache.activemq.transport.TransportFactory.findTransportFactory(
... 9 more

If I come on web console and I ping related pools, the pings fail. I must disable each RAR connectors in web console and reenable each and then the pings succeeded.

I read that is a classloader problem but I don't know how to fix :