Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-258

getting error when trying to use IBM MQ JMS implementation as transport.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 M1
    • Fix Version/s: 1.5 M2
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows XP, JDK 1.5, Eclipse 3.3, IBM MQ 6.0.0.0 - j000-L050519.1, SAAJ 1.2

      Description

      I already have a working version of Spring 1.0 with JMS/MQ as transport. We extended 1.0 to add that support. Since 1.5 has built-in support, I am trying to use 1.5 M1. I am getting following error when I try to send a message. Including configuration file except and also exception trace.

      This framework has been excellent help so far. It is well written. Thanks for developing this.

      I will also be doing investigation regarding this issue.

      Configuration :

      <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
      <property name="environment">
      <props>
      <prop key="java.naming.factory.initial">com.ibm.mq.jms.context.WMQInitialContextFactory</prop>
      <prop key="java.naming.provider.url">QM_wwhq458m</prop>
      </props>
      </property>
      </bean>

      <!-- JMS Queue Connection Factory -->
      <bean id="internalJmsQueueConnectionFactory"
      class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiTemplate">
      <ref bean="jndiTemplate"/>
      </property>
      <property name="jndiName">
      <value>QM_wwhq458m</value>
      </property>
      </bean>

      <!-- Spring JMS Queue Connection Factory -->
      <bean id="jmsQueueConnectionFactory"
      class="org.springframework.jms.connection.SingleConnectionFactory102">
      <property name="targetConnectionFactory">
      <ref bean="internalJmsQueueConnectionFactory"/>
      </property>
      <property name="pubSubDomain">
      <value>false</value>
      </property>
      </bean>

      <!-- JMS Destination Resolver -->
      <bean id="jmsDestinationResolver"
      class="org.springframework.jms.support.destination.JndiDestinationResolver">
      <property name="jndiTemplate">
      <ref bean="jndiTemplate"/>
      </property>
      <property name="cache">
      <value>true</value>
      </property>
      </bean>

      <bean id="JMSMQSender" class="org.springframework.ws.transport.jms.JmsMessageSender">
      <property name="connectionFactory" ref="jmsQueueConnectionFactory"/>
      </bean>
      <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
      <property name="messageSenders">
      <list>
      <ref local="JMSMQSender" />
      <ref local="HttpUrlConnectionMessageSender" />
      </list>
      </property>
      <property name="defaultUri" value="jms:RequestQueue?deliveryMode=NON_PERSISTENT"/>
      <property name="marshaller">
      <ref local="RequestPayloadMarshaller" />
      </property>
      <property name="unmarshaller">
      <ref local="ResponsePayloadUnmarshaller" />
      </property>
      </bean>

      Exception Trace :

      Caused by: org.springframework.ws.client.WebServiceTransportException: Could not use transport: Could not set property: MQJMS1058: Invalid message property name: Content-Type; nested exception is org.springframework.ws.transport.jms.JmsTransportException: Could not set property: MQJMS1058: Invalid message property name: Content-Type
      at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:430)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:360)
      at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:306)
      at com.ual.caribou.transport.JMSTransportNew.invoke(JMSTransportNew.java:70)
      at com.ual.caribou.core.CaribouDispatchImpl.invoke(CaribouDispatchImpl.java:118)
      ... 20 more
      Caused by: org.springframework.ws.transport.jms.JmsTransportException: Could not set property: MQJMS1058: Invalid message property name: Content-Type
      at org.springframework.ws.transport.jms.JmsSenderConnection.addRequestHeader(JmsSenderConnection.java:152)
      at org.springframework.ws.transport.AbstractSenderConnection$RequestTransportOutputStream.addHeader(AbstractSenderConnection.java:108)
      at org.springframework.ws.soap.saaj.Saaj12Implementation.writeTo(Saaj12Implementation.java:247)
      at org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(SaajSoapMessage.java:118)
      at org.springframework.ws.transport.AbstractWebServiceConnection.send(AbstractWebServiceConnection.java:36)
      at org.springframework.ws.client.core.WebServiceTemplate.sendRequest(WebServiceTemplate.java:550)
      at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:408)
      ... 24 more
      Caused by: javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: Content-Type
      at com.ibm.jms.JMSMessage.newMessageFormatException(JMSMessage.java:4674)
      at com.ibm.jms.JMSMessage.setStringProperty(JMSMessage.java:5658)
      at org.springframework.ws.transport.jms.JmsSenderConnection.addRequestHeader(JmsSenderConnection.java:149)
      ... 30 more

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        It seems like JMS properties can only contain valid Java identifiers, and therefore not contain dashes. Guess we need some conversion mechanism to convert from JMS properties to transport headers.

        Show
        arjen.poutsma Arjen Poutsma added a comment - It seems like JMS properties can only contain valid Java identifiers, and therefore not contain dashes. Guess we need some conversion mechanism to convert from JMS properties to transport headers.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        The JMS over SOAP spec (http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200701.mbox/raw/%[email protected]ss.com%3E/3#requester-states) suggests using SOAPJMS_contentType as property name.

        I'm not so sure whether that's a good solution, because it makes the transport SOAP-specific (though only in property names).

        Show
        arjen.poutsma Arjen Poutsma added a comment - The JMS over SOAP spec ( http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200701.mbox/raw/%[email protected]ss.com%3E/3#requester-states ) suggests using SOAPJMS_contentType as property name. I'm not so sure whether that's a good solution, because it makes the transport SOAP-specific (though only in property names).
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Fixed.

        Could you try a snapshot (http://static.springframework.org/spring-ws/sites/1.5/downloads/snapshots.html) and see if it works now with IBM MQ?

        Make sure to get a recent snapshot: snapshots dated 2008-01-23 and higher contain the fix.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Fixed. Could you try a snapshot ( http://static.springframework.org/spring-ws/sites/1.5/downloads/snapshots.html ) and see if it works now with IBM MQ? Make sure to get a recent snapshot: snapshots dated 2008-01-23 and higher contain the fix.
        Hide
        thapasya1 BN added a comment -

        Arjen,

        It is working.

        Thanks.

        Show
        thapasya1 BN added a comment - Arjen, It is working. Thanks.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing 1.5 M2 issues.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing 1.5 M2 issues.

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            thapasya1 BN
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: