Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-566

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0-M2
    • 3.0
    • servicemix-components
    • None
    • Java 1.5.0_06
      SwiftMQ

    Description

      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.

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            gingming Ging Ming Chan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: