activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Zarra <mza...@mac.com>
Subject Re: Tomcat hang-up
Date Wed, 14 Jun 2006 06:31:04 GMT
Thanks for the reply.  I am using a 4.0 build of ActiveMQ running on  
Tomcat 4.x.  When this test is being run there are no external  
connections to the broker other than from Tomcat.  Even in a  
production environment there would not be more than 10.

Is there any way to turn on additional logging so I can see what is  
going on inside of ActiveMQ?  The reason I ask is that if I kill the  
broker (which is embedded inside of a standalone server application)  
then tomcat comes back to life with some errors complaining about the  
connection being broken.  I would love to see what is stopping up the  
works.

BTW, The other "client" that connects to this broker that is not  
inside of tomcat can talk with it just fine.

I am stumped.

Marcus

On Jun 14, 2006, at 12:26 AM, James Strachan wrote:

> BTW how many connections are being created? (Might be worth adding
> some logging).
> You could add some synchronization to ensure that you don't create
> lots of connections.
>
> On 6/14/06, James Strachan <james.strachan@gmail.com> wrote:
>> That code looks fine to me. I've no idea why this can be causing a
>> hang. Which version are you using?
>>
>> Does attempting to create a thread dump give you anything?
>>
>> On 6/13/06, Marcus Zarra <mzarra@mac.com> wrote:
>> > Hopefully this is a simple question that has been answered  
>> before.  I
>> > am attempting to connect to an ActiveMQ broker from tomcat and the
>> > broker is running on another machine.  The tomcat version that is
>> > being used is old enough that I cannot put a context.xml in  
>> place and
>> > access the broker via a context lookup.  Therefore I am simply
>> > attempting to connect to the broker inside of the init method for a
>> > servlet using the following code:
>> >
>> >          o = getServletContext().getAttribute("queueConnection");
>> >          Connection connection;
>> >          if (o == null) {
>> >              String jmsURL = getServletContext().getInitParameter
>> > ("JMS_URL");
>> >              log.info("URL is '" + jmsURL + "'");
>> >              ActiveMQConnectionFactory connectionFactory;
>> >              try {
>> >                  log.info("Connecting to JMS");
>> >                  connectionFactory = new ActiveMQConnectionFactory
>> > (jmsURL);
>> >                  log.info("Factory initialized");
>> >                  connection = connectionFactory.createConnection();
>> >                  log.info("Connection established");
>> >                  connection.start();
>> >                  log.info("Connection started");
>> >                  getServletContext().setAttribute 
>> ("queueConnection",
>> > connection);
>> >              } catch (Throwable e) {
>> >                  log.error("Error initializing JMS Connection", e);
>> >                  throw new RuntimeException("Failed to  
>> initialize JMS
>> > Connection");
>> >              }
>> >          } else {
>> >              connection = (QueueConnection)o;
>> >          }
>> >
>> >
>> > There is some additional things going on in the init method but  
>> this
>> > is the area having an issue.  The issue is that the code stops dead
>> > on connection.start() every time and locks so hard that I need to
>> > kill -9 tomcat.
>> >
>> > Has anyone seen and/or resolved this issue before?  Or is there a
>> > cleaner/safer way to establish a connection to a broker from inside
>> > of a 4.x tomcat instance.
>> >
>> > Thanks,
>> >
>> > Marcus
>> >
>>
>>
>> --
>>
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>>
>
>
> -- 
>
> James
> -------
> http://radio.weblogs.com/0112098/


Mime
View raw message