Announcement Announcement Module
Collapse
No announcement yet.
Spring JMS Listener and Tomcat Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JMS Listener and Tomcat

    hi everybody,

    I'm having a problem when running Spring 2.5 over Tomcat 6 and HornetQ. A JMS listener like this:

    <bean id="receiveQueue" class="org.springframework.jndi.JndiObjectFactoryB ean" lazy-init="true">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName" value="/queue/TEMQueue" />
    </bean>

    <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean" lazy-init="true">
    <property name="jndiTemplate">
    <ref bean="jndiTemplate" />
    </property>
    <property name="jndiName">
    <value>/ConnectionFactory</value>
    </property>
    </bean>

    <bean id="queueListenerContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="destination" ref="receiveQueue"/>
    <property name="messageListener" ref="syncronizationConsumer" /><!-- MY BEAN WITH ONMESSAGE METHOD -->
    </bean>


    The problem is that when I start Tomcat all works fine. The message are read and the onMessage method is called, but if I shutdown Tomcat and restart it, the listener can't read messages anymore. And the same code in a stand alone application works fine. Does anyone have any idea ?

    Thanks in advance,

    Sergio Stateri Jr.
    sergio.stateri@globo.com
Working...
X