Lingo
  1. Lingo
  2. LINGO-6

marshaller in JmsServiceExporter uninitialized due to multi-threading (experienced on Websphere MQ 5.3)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-M1
    • Fix Version/s: 1.0
    • Labels:
      None
    • Environment:
      Websphere MQ 5.3, connectionFactory = com.ibm.mq.jms.MQQueueConnectionFactory; transportType = 1 (TCP/IP, thin java-only client)
    • Number of attachments :
      0

      Description

      In JmsServiceExporter, following code means that JMSServiceExporter.onMessage can be called in another thread before super.afterProperties initializes the marshaller, leading to "MQJMS1034E MessageListener threw: java.lang.NullPointerException" error

      ...
      // do we have a destination specified, if so consume
      if (destination != null)

      { Session session = producer.getSession(); consumer = session.createConsumer(destination); consumer.setMessageListener(this); }

      super.afterPropertiesSet();
      }

      Possible solution may be to call super.afterPropertiesSet() before calling consumer.setMessageListener(this), this seems to be where the thread is being created by Websphere MQ implementation

        Activity

        Hide
        james strachan added a comment -

        Thanks for spotting this - we ensure we call super.afterPropertiesSet() before starting the consumer

        Show
        james strachan added a comment - Thanks for spotting this - we ensure we call super.afterPropertiesSet() before starting the consumer

          People

          • Assignee:
            Unassigned
            Reporter:
            Justin Rowe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: