Announcement Announcement Module
Collapse
No announcement yet.
javax.jms.MessageFormatException: MQJMS1058: Invalid message property name:JMSXUserID Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • javax.jms.MessageFormatException: MQJMS1058: Invalid message property name:JMSXUserID

    We are getting a lot of these warnings even though we are not setting any JMSX properties. Please suggest on how to avoid these warnings. We are seeing this error consistently for every message.
    Code:
    2010-05-05 07:49:42,153 WARN  [pool-1-thread-1] jms.DefaultJmsHeaderMapper - failed to map Message header 'JMSXUserID' to JMS property
    javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: JMSXUserID
    	at com.ibm.jms.JMSMessage.newMessageFormatException(JMSMessage.java:4751)
    	at com.ibm.jms.JMSMessage.setObjectProperty(JMSMessage.java:5655)
    	at org.springframework.integration.jms.DefaultJmsHeaderMapper.fromHeaders(DefaultJmsHeaderMapper.java:84)
    	at org.springframework.integration.jms.HeaderMappingMessageConverter.toMessage(HeaderMappingMessageConverter.java:177)
    	at org.springframework.jms.core.JmsTemplate$5.createMessage(JmsTemplate.java:619)
    	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:570)
    	at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:541)
    	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
    	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:539)
    	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:617)
    	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:609)
    	at org.springframework.integration.jms.JmsSendingMessageHandler.handleMessage(JmsSendingMessageHandler.java:62)
    	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:103)
    	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:90)
    	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:43)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
    	at org.springframework.integration.channel.MessageChannelTemplate.doSend(MessageChannelTemplate.java:223)
    	at org.springframework.integration.channel.MessageChannelTemplate.send(MessageChannelTemplate.java:180)
    	at org.springframework.integration.handler.DelayHandler.releaseMessage(DelayHandler.java:229)
    	at org.springframework.integration.handler.DelayHandler.access$0(DelayHandler.java:227)
    	at org.springframework.integration.handler.DelayHandler$1.run(DelayHandler.java:207)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Last edited by srikanthradix; May 5th, 2010, 06:32 PM.

  • #2
    Could you please post the relevant code and configuration, too?

    Comment


    • #3
      Relevant Code and Configuration.

      The following is the code that reads via MQ Queue and sends to MQ Queue using Message Converter(reads from jms:message-driven-channel-adapter and writes to jms:outbound-channel-adapter)
      Code:
          <bean id="common.durableListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
                  abstract="true">
              <property name="sessionTransacted" value="true"/>
              <property name="pubSubDomain" value="false"></property>
          </bean>    
                       
          <jms:message-driven-channel-adapter id="proj.Reader"
                                              container="proj.recvQueueContainer"
                                              message-converter="proj.MessageConverter"
                                              channel="proj.toProcess"/>           
                                              
          <bean id="proj.recvQueueContainer" parent="common.durableListenerContainer" >
      	        <property name="connectionFactory" ref="common-ibmmq.queueConnectionFactory"></property>
              	<property name="destination" ref="common.projRecvQueue"></property>
          </bean>
          
              <jms:outbound-channel-adapter id="proj.QueueSender"
                                        channel="proj.to" jms-template="proj.outboundJmsTemplate"/>
          
          	    <bean id="proj.outboundJmsTemplate" parent="common-ibmmq.queueJmsTemplate">
          	        <property name="messageConverter" ref="proj.MessageConverter"/>
          	        <property name="defaultDestination" ref="common.projSendQueue"/>
                  </bean>
                  
                  
                      <bean id="proj.MessageConverter" class="com.ubs.etdet.skore.jms.ProjTransferObjectMessageConverter">
      	            <constructor-arg value="fat-processor"/>
      	            <constructor-arg value="true"/>
      	            <property name="maxRedeliveryCount" value="${message.max_redelivery}" />
                      </bean>
                  
          
          	<bean id="common-ibmmq.queueConnectionFactory" class="com.ibm.mq.jms.MQConnectionFactory" lazy-init="true">
          		<property name="queueManager" value="${mq.conn.fac.name.mgr}" />
          		<property name="hostName" value="${mq.conn.fac.host}" />
          		<property name="port" value="${mq.conn.fac.port}" />
          		<property name="channel" value="${mq.conn.fac.channel}" />
          		<property name="transportType" value="1" />				
          	</bean>
          
          	<bean id="common-ibmmq.baseJmsTemplate" abstract="true"
          		class="org.springframework.jms.core.JmsTemplate" />
          
          	<bean id="common-ibmmq.queueJmsTemplate" parent="common-ibmmq.baseJmsTemplate" lazy-init="true">
          		<property name="connectionFactory" ref="common-ibmmq.queueConnectionFactory" />
      	</bean>
      	
      	
      	
      public class ProjTransferObjectMessageConverter extends AbstractLoggingMessageConverter {
      	
      	String messageId = "";
      	private Integer redeliveryCount = 0;
      	public Integer maxRedeliveryCount = 0; 
      
      	public void setMaxRedeliveryCount(Integer maxRedeliveryCount) {
      		this.maxRedeliveryCount = maxRedeliveryCount;
      	}
      
      	public ProjTransferObjectMessageConverter(String appName, boolean doLog) {
              super(appName, doLog);
          }
      
          private static final XStream xs = new XStream(new XppDriver());
          static {
              xs.registerConverter(new EnumSingleValueConverter<ProjAllocationStatus>(ProjAllocationStatus.class));
              xs.registerConverter(new EnumSingleValueConverter<ProjMessageType>(ProjMessageType.class));
          }
      
          @Override
          public Message toMessage(final Object message, final Session session)
                  throws JMSException, MessageConversionException {
          	
              if (message instanceof MTO) {
                  MTO mto = (MTO) message;
                  beforeLog("toMessage", mto.getInitialOrderRef(), mto.getOrderId(), mto, true);
                  ProjTransferObject fto = (ProjTransferObject)mto;
                  BytesMessage toSend = session.createBytesMessage();
                  toSend.writeBytes(xs.toXML(fto).getBytes());
                  afterLog("toMessage", mto.getInitialOrderRef(), mto.getOrderId(), toSend, false);
                  return toSend;
              }
              return null;
          }
      
          
      
          @Override
          public Object fromMessage(final Message message) throws JMSException, MessageConversionException {
          	
          	
          	if(maxRedeliveryCount > 0) {
          		redeliveryCount = MessageUtils.incrementRedeliveryCount(message, messageId, redeliveryCount);
          		if(redeliveryCount > maxRedeliveryCount) {
          	    	errorLog("Reached maximum retries after encountering an ERROR_MESSAGE  ", message.toString());
          	    	errorLog("fromMessage", message.toString());
          	    	return MessageUtils.buildErrorMTO(message);
              	} else if (redeliveryCount > 1) {
          	    	errorLog("Retry message-count:" + redeliveryCount, "");
              	} else {
              		messageId = message.getJMSMessageID();
              	}
          	}
          	
              if (message instanceof BytesMessage) {
                  beforeLog("fromMessage", null, null, message, true);
                  BytesMessage bm = (BytesMessage) message;
                  byte[] array = new byte[(int) bm.getBodyLength()];
                  bm.readBytes(array);
                  Object o = xs.fromXML(new String(array)); 
                  beforeLog("fromMessage", null, null, o, true);
                  return o;
              }
              return null;
          }
      }

      Comment


      • #4
        I can see two simple options to fix the problem:
        1. make sure, that the Spring Integration Message doesn't contain the user, as DefaultJmsHeaderMapper sets only the properties, which are in the message
        2. Create your own JmsHeaderMapper class, which excludes illegal properties and inject it.

        HTH

        Comment

        Working...
        X