activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From siegeld <>
Subject Using ActiveMQ with Tomcat 6 - IllegalStateException problem
Date Sun, 23 Sep 2007 03:15:15 GMT

I am attempting to run ActiveMQ in a servlet (GWT-based) on Tomcat6.   I
actually have it working, but in my catalina.log file, I get a frequent
stream of IllegalStateExceptions (see stacktrace, below).  The code in my
servlet looks like the following:

  ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(_url);

        try {
            _connection = factory.createConnection();
            _session = _connection.createSession(false,

            _commandQueue =
            _responseTopic =

            _publisher = _session.createProducer(_commandQueue);

            _consumer = _session.createConsumer(_responseTopic);



        } catch (JMSException e) {
            System.out.println("JMS error: " + e.getMessage());

Interesting, I get the exception every time a new message arrives.  The
message is actually processed correctly, I just get the exception in the log

One thing I am wondering about is how this is all working anyway.  I assume
that the servlet I have created keeps running, and that ActiveMQ starts a
new thread that is processing messages in the background.  Is this correct? 
If the servlet were to shutdown for some reason, I don't know what would
happen to this thread.  Overall, is this the correct way to have a servlet
receive and send JMS messages with ActiveMQ?

Thanks for your help.

Error stacktrace:

Sep 22, 2007 3:26:10 PM org.apache.catalina.loader.WebappClassLoader
INFO: Illegal access: this web application instance has been stopped
already.  Could not load com.siegel.insteon.MessageSetOnLevel.  The eventual
following stack trace is caused by an error thrown for debugging purposes as
well as to attempt to terminate the thread which caused the illegal access,
and has no functional impact.
        at org.apache.activemq.util.ClassLoading.load(

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

View raw message