activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From everett <>
Subject Re: ActiveMQ causes application to hang on Glassfish
Date Mon, 07 Jul 2008 16:54:54 GMT

Hi Hans,

Hans Bausewein wrote:
> everett wrote:
>> Hi,
>> I am using the 5.1.0 release of ActiveMQ. My JVM is version 1.6.0_06 and
>> I am running on Debian Sid. I have a Java web application which uses
>> ActiveMQ that I have deployed in Glassfish V2 UR2. Both Glassfish and
>> ActiveMQ are running on the same server.
>> ............
> Probably a classloading conflict between GlassFish JMS classes and the
> ActiveMQ implementation.
> The only way to do this properly is to install the ActiveMQ resource
> adapter in GlassFish.
> See
> The resource adapter binds the ActiveMQ ConnectionFactory into JNDI and
> your application does a JNDI lookup to get it.
> This has many advantages:
> - No direct dependency of your application on ActiveMQ
> - connection pooling
> - clustering
> - failover
> Hans

Thank you for the tip. I've taken a look at Ramesh's excellent guide
but it goes a bit over my head in certain places.

I specifically have difficulty understanding two things:

1. The filesystem JNDI object store
2. How to deploy a sun-ejb-jar.xml file

Regarding the JNDI object store creation code
(, am I supposed
to deploy it with my web app?

Instead of a filesystem object store I tried with a file:

        java.naming.factory.initial =
        java.naming.provider.url = stomp://localhost:61613

I managed to do everything else Ramesh specified, and I deployed the
sun-ejb-jar.xml file he provides in my META-INF directory. Is that the
correct location?

I tried using the following code in my web app (based on

        import javax.jms.Connection;
        import javax.jms.ConnectionFactory;

        ConnectionFactory connectionFactory =
        Connection connection = connectionFactory.createConnection();

When I then run the code I get an exception:

        javax.naming.NameNotFoundException: ConnectionFactory not found

What am I doing wrong?

I apologize for my ignorance. ActiveMQ is great software which I would
prefer to use to RabbitMQ (which appears to be my only option if I don't get
this working).

Again, I appreciate your help.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message