Announcement Announcement Module
No announcement yet.
JBoss/Spring JMS integration - Illegal property name: JMSXDeliveryCount Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JBoss/Spring JMS integration - Illegal property name: JMSXDeliveryCount


    I am new to spring integration and trying to figure out the following error.
    Trying to create a simple inbound/outbound JMS adapter, using JBoss (4.2.2.GA). I have defined a jms:inbound-channel-adapter connected to the requestQueue, and a jms:outbound-channel-adapter connected to the sendQueue. Also a service activator which is a simple bean that prints the JMS message.
    I have succesfully sent a message to the requestQueue from JBoss, which is picked up by and printed by the bean, but when the jms:outbound-channel-adapter sends the message back to the JBoss sendQueue i receive the following error:

    Mar 23, 2009 7:49:36 AM 
    WARNING: failed to map Message header 'JMSXDeliveryCount' to JMS property
    javax-jms-JMSException: Illegal property name: JMSXDeliveryCount
    JMS adapter settings:
    <jms:inbound-channel-adapter id="jmsin" destination="requestQueue" channel="inputChannel"/>
    	<channel id="jmsinToStdoutChannel"/>
    	<stream:stdout-channel-adapter id="stdout" channel="jmsinToStdoutChannel" append-newline="true"/>
      	<channel id="inputChannel"/>
    	<service-activator input-channel="inputChannel"
    	<beans:bean id="helloService" class="org.springframework.integration.samples.helloworld.HelloService"/>
    	<channel id="outputChannel">
    		<queue capacity="10"/>
    	<jms:outbound-channel-adapter id="jmsout" destination="sendQueue" channel="outputChannel" extract-payload="false" />

    JBoss connection settings:
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
            <property name="environment">
                    <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
                    <prop key="java.naming.provider.url">localhost</prop>
                    <prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop>
        <!-- JMS Queue Connection Factory -->
        <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiTemplate">
                <ref bean="jndiTemplate"/>
            <property name="jndiName">
        <!-- JMS Destination for Receive Queue -->
        <bean id="requestQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiTemplate">
                <ref bean="jndiTemplate"/>
            <property name="jndiName">
        <!-- JMS Destination for Sender Queue-->
        <bean id="sendQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiTemplate">
                <ref bean="jndiTemplate"/>
            <property name="jndiName">
        <integration:poller id="poller" default="true">
          <integration:interval-trigger interval="1000"/>
    Again, since I am new to spring integration, I might be missing some key points, by searching the forum, I barely found any JBoss/Spring integration (mostly MQ), I would appreciate any kind of help with the following problem.

    thanks in advance,

  • #2
    What happens here is that SI asks JBoss nicely to set the property 'JMSXDeliveryCount', upon which JBoss throws an exception because this property is reserved by the JMS spec.

    It looks somewhat related to this

    However the property came to exist in the message header, we shouldn't set it, so that's why this is only logged as a warning. You can investigate how the property came to exist on the header, this could either be a JBoss or SI bug or a bug in your own code.


    • #3
      This is most likely because of the successive inbound & outbound mapping of the JMS<->Message Header properties. JMS reserved properties need to be left out in the process (most likely on outbound mapping).


      • #4
        Maybe the loglevel can go down to INFO, but they are already left out automatically if the JMS implementation is correct. We can't just ignore them on inbound, as we'll then rob the users of the option to read them and act on them (which they probably shouldn't).

        I'm pretty sure the message is sent normally and the warning message is harmless.


        • #5
          I meant: we shouldn't try to set them in the first place (and that, said in a convoluted fashion ), rather than ignoring them when inbound (that's a less appealing and less useful alternative).

          But your point is right - it's a warning, not an error, so this is, to quote a classic, "Mostly Harmless".



          • #6
            @Tom08 Did you get all that? If you think we need to change something, please create an issue linking back to this thread .


            • #7
              thank you guys for the quick repsonse. Regarding my issue, I have checked the JMS message I am sending from JBOSS and the JMS properties is set with {JMSXDeliveryCount=1}.

              INFO: Message Received: SpyTextMessage {
              Header { 
                 jmsDestination  : QUEUE.jms/queue
                 jmsDeliveryMode : 2
                 jmsExpiration   : 0
                 jmsPriority     : 4
                 jmsMessageID    : ID:2-12379673615316
                 jmsTimeStamp    : 1237967361531
                 jmsCorrelationID: null
                 jmsReplyTo      : null
                 jmsType         : null
                 jmsRedelivered  : false
                 jmsProperties   : {JMSXDeliveryCount=1}
                 jmsPropReadWrite: false
                 msgReadOnly     : true
                 producerClientId: ID:2
              Body {
                 text            :message from queue
              I am not sure if i mentioned my problem is not with the warning message, but rather the with the following exception when trying to send the message back to Jboss (to another queue).

              Mar 25, 2009 9:42:46 AM org.springframework.integration.jms.DefaultJmsHeaderMapper fromHeaders
              WARNING: failed to map Message header 'JMSXDeliveryCount' to JMS property
              javax.jms.JMSException: Illegal property name: JMSXDeliveryCount
              	at org.springframework.integration.jms.DefaultJmsHeaderMapper.fromHeaders(
              	at org.springframework.integration.jms.HeaderMappingMessageConverter.toMessage(
              	at org.springframework.jms.core.JmsTemplate$5.createMessage(
              I will check how the property came to exist on the header, but is there some kind of workaround that i could do in SI in order not to include this property in the mapping.


              • #8
                That property is not being included in the mapping in SI. The WARNING is being logged to inform you that it is not being included. That means that the outbound Message would not have the property (it's illegal to set a user property on the message with that prefix).

                That WARNING message is logging the Exception that it *caught* to prevent this situation from causing any failure. That means that the Message should indeed be sent to the other queue. Are you sure that the Message is not actually being sent to that queue?


                • #9
                  Thank you guys. I found the problem, it was the <extract-payload="false"> value that I included in <jms:outbound-channel-adapter>

                  This is also described in the manual! (RTFM)
                  so thanks again!

                  As with the inbound Channel Adapters, there is an 'extract-payload' property. However, the meaning is
                  reversed for the outbound adapter. Rather than applying to the JMS Message, the boolean property
                  applies to the Spring Integration Message payload. In other words, the decision is whether to pass the
                  Spring Integration Message itself as the JMS Message body or whether to pass the Spring Integration
                  Message's payload as the JMS Message body. The default value is once again 'true'. Therefore, if you pass
                  a Spring Integration Message whose payload is a String, a JMS TextMessage will be created. If on the
                  other hand you want to send the actual Spring Integration Message to another system via JMS, then
                  simply set this to 'false'.

                  The WARNING: failed to map Message header 'JMSXDeliveryCount' to JMS property is indeed just a warning and did not affect the delivery of the message.