Announcement Announcement Module
Collapse
No announcement yet.
No message listener specified Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No message listener specified

    Hi,

    Our application requires JMS topic subscribers. We use the DefaultMessageListenerContainer and MessageListenerAdapter classes, as well as POJOs with a listener method specified declaratively.

    When the beans are declared as singletons, it works great.

    When the beans are declared as prototypes, it does not work. The following exception is thrown:
    Code:
    java.lang.IllegalStateException: No message listener specified - see property 'messageListener'
    You will find below my beans declarations (class names are abbreviated). The prototypes are instantiated by retrieving them from the beans factory with getBean(). The containerProto is customized with setMessageSelector() and setMessageListener() , and the messageListenerAdapterProto is customized with setDelegate().

    By the way, we use Spring 2.5.1 and ActiveMQ 5.0.0.

    Thanks for your help,

    Francois

    Code:
    <bean id="containerProto" class=" DefaultMessageListenerContainer" scope="prototype">
            <property name="connectionFactory" ref="singleConnectionFactory" />
            <property name="destination" ref="topic" />
            <!-- messageSelector and messageListener to be set programmatically -->
    </bean> 
    
    <bean id="messageListenerAdapterProto" class="MessageListenerAdapter" scope="prototype">
            <property name="defaultListenerMethod" value="notify"/>
            <property name="defaultResponseDestination" ref="topic"/>
            <!-- delegate to be set programmatically -->
    </bean>
Working...
X