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

  • DefaultJmsHeaderMapper error

    I am trying to read message from a WMQ queue using jms-source and its giving me following exception :

    Code:
    18:00:21,141 WARN  [MessagePublishingErrorHandler] failure occurred in messaging task
    org.springframework.integration.message.MessagingException: failed to map from MessageHeader
    	at org.springframework.integration.adapter.jms.DefaultJmsHeaderMapper.mapFromMessageHeader(DefaultJmsHeaderMapper.java:72)
    	at org.springframework.integration.adapter.jms.DefaultJmsHeaderMapper.mapFromMessageHeader(DefaultJmsHeaderMapper.java:1)
    	at org.springframework.integration.adapter.jms.HeaderMappingMessageConverter.toMessage(HeaderMappingMessageConverter.java:67)
    	at org.springframework.jms.core.JmsTemplate$6.createMessage(JmsTemplate.java:616)
    	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:557)
    	at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:538)
    	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:459)
    	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:535)
    	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:614)
    	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:599)
    	at org.springframework.integration.adapter.jms.JmsTargetAdapter.send(JmsTargetAdapter.java:54)
    	at org.springframework.integration.endpoint.TargetEndpoint.send(TargetEndpoint.java:211)
    	at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:91)
    	at org.springframework.integration.dispatcher.PollingDispatcher.run(PollingDispatcher.java:65)
    	at org.springframework.integration.scheduling.SimpleMessagingTaskScheduler$MessagingTaskRunner.run(SimpleMessagingTaskScheduler.java:138)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
    	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: JMSXDeliveryCount
    	at com.ibm.jms.JMSMessage.newMessageFormatException(JMSMessage.java:4674)
    	at com.ibm.jms.JMSMessage.setObjectProperty(JMSMessage.java:5564)
    	at org.springframework.integration.adapter.jms.DefaultJmsHeaderMapper.mapFromMessageHeader(DefaultJmsHeaderMapper.java:65)
    	... 23 more
    What could be the issue ? and should it be throwing an exception in the case that it is not able to map the JMS headers ?

  • #2
    The property value is being retrieved from the inbound JMS Message and stored in the Spring Integration MessageHeader. Then on your response, it is automatically mapping that value back to the outbound JMS Message. Unfortunately, that particular value is intended for reading only.

    Please raise an issue in JIRA for this.

    In the short term, you could set your own MessageHeaderMapper implementation. That is not available currently in the namespace support, but you can create the source as a <bean/> element. The other short term option is to remove the attribute value from the header in a MessageHandler.

    I agree that the Exception being rethrown in this case might be too extreme, and I will make a change for that in particular ASAP.

    -Mark

    Comment


    • #3
      I went ahead and created the following two issues in JIRA:

      http://jira.springframework.org/browse/INT-205
      http://jira.springframework.org/browse/INT-206

      Comment


      • #4
        I have just committed a change to prevent such exceptions from producing a fatal condition. This includes not only JMSExceptions but also others that may occur while trying to set JMS properties (e.g. IllegalArgumentException).

        If you check out the latest version from SVN or grab tonight's nightly snapshot (when available), the exception will simply be logged at WARN level instead.

        Regards,
        Mark

        Comment


        • #5
          Thanks Mark..that did work ..but have you changed the schema for the endpoint to have 'handler' instead of 'handler-ref' now ?

          Comment


          • #6
            Yes, the <endpoint/> element now takes 'handler' instead of 'handler-ref'. Also, the <handler/> subelement has been removed.

            There are actually some rather significant changes in the works for the namespace, so I apologize in advance, but it's important that we get the changes out there while still in the milestone release phase.

            Just as a quick description, instead of just <endpoint/>, we will have <source-endpoint/> <target-endpoint/> and <handler-endpoint/>. Other attribute names will very likely be changing as well (e.g. "input-channel" -> "input" and "handler-method" -> "method").

            In most cases, it should require just a find+replace.

            Mark

            Comment

            Working...
            X