JmsReceiverComponent trying to receive message before its JBI properties have 
been fully initialised
----------------------------------------------------------------------------------------------------

                 Key: SM-566
                 URL: https://issues.apache.org/activemq/browse/SM-566
             Project: ServiceMix
          Issue Type: Bug
          Components: servicemix-components
    Affects Versions: 3.0-M2
         Environment: Java 1.5.0_06
SwiftMQ

            Reporter: Ging Ming Chan


When ServiceMix with the JmsReceiverComponent configured is started and there 
is already JMS messages waiting in the queue, it will throw the following 
exception:

ERROR! MessageListener throws RuntimeException, shutting down consumer!
org.apache.servicemix.jbi.RuntimeJBIException: 
org.apache.servicemix.jbi.NotInitialisedYetException: Cannot perform operations 
on this component until it has been initialised via init()
        at 
org.apache.servicemix.components.jms.JmsInBinding.onMessage(JmsInBinding.java:74)
        at 
com.swiftmq.jms.v510.MessageConsumerImpl.invokeMessageListener(Unknown Source)
        at com.swiftmq.jms.v510.MessageConsumerImpl.invokeConsumer(Unknown 
Source)
        at 
com.swiftmq.jms.v510.SessionImpl$SessionDeliveryQueue.process(Unknown Source)
        at com.swiftmq.tools.queue.SingleProcessorQueue.dequeue(Unknown Source)
        at com.swiftmq.jms.v510.SessionImpl$SessionTask.run(Unknown Source)
        at com.swiftmq.client.thread.PoolExecutor.run(Unknown Source)
Caused by: org.apache.servicemix.jbi.NotInitialisedYetException: Cannot perform 
operations on this component until it has been initialised via init()
        at 
org.apache.servicemix.components.util.PojoSupport.getDeliveryChannel(PojoSupport.java:193)
        at 
org.apache.servicemix.components.jms.JmsInBinding.onMessage(JmsInBinding.java:59)
        ... 6 more

The cause of the error was traced to the codes in the JmsReceiverComponent 
.afterPropertiesSet() that open the connection and receive JMS messages before 
the JBI properties of the component have been set.  A possible solution is to 
override the ComponentLifeCycle.init(ComponentContext cc) method to include the 
related codes in the JmsReceiverComponent .afterPropertiesSet() method.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to