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

When using permanent replyTo queues, their JNDI names can't start with jms/ in the defaultUri property of the WebServiceGateway

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.5
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Websphere AppSrv 6.1

      Description

      We are using permanent queues defined as JNDI resources in a WAS 6.1. Their JNDI names start with jms/, for instance jms/RESPONSE_QUEUE.
      We have a client which is configured like this, along side with a jndiDestinationResolver and a jndiTemplate:
      [code]
      <bean id="serviceGateway" class="net.croz.client.ServiceGatewayImpl">
      <property name="defaultUri" value="jms:jms/REQUEST_QUEUE?replyToName=jms/REPLY_QUEUE" />
      <property name="messageSenders">
      <bean class="org.springframework.ws.transport.jms.JmsMessageSender">
      <property name="connectionFactory" ref="mqConnectionFactory" />
      <property name="pubSubDomain" value="false" />
      <property name="destinationResolver" ref="jndiDestinationResolver"></property>
      <property name="receiveTimeout" value="10000"></property>
      </bean>
      </property>
      </bean>

      <bean id="jndiTemplate"
      class="org.springframework.jndi.JndiTemplate">
      <property name="environment">
      <props>
      <prop key="java.naming.factory.initial">com.ibm.websphere.naming.WsnInitialContextFactory</prop>
      <prop key="java.naming.provider.url">iiop://localhost:2810</prop>
      </props>
      </property>
      </bean>

      <bean id="jndiDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver">
      <property name="jndiTemplate" ref="jndiTemplate"></property>
      </bean>
      [code/]

      When invoking a fully functional web service (under our control), the request ends up in the REQUEST_QUEUE, but when the client tries to find the RESPONSE_QUEUE via its JNDI name (jms/REPLY_QUEUE) it fails with:
      [code]
      Destination [jms] not found in JNDI; nested exception is org.springframework.jndi.TypeMismatchNamingException: Object of type [class com.ibm.ws.naming.jndicos.CNContextImpl] available at JNDI location [jms] is not assignable to [javax.jms.Destination]
      [/code]

      Observe the "..available at JNDI location [jms]..." part in particular... This led me to investigate the code responsible for parsing the defaultUri property of the WebServiceGateway. What I've found is that the regular expression responsible for the parsing of the replyToName part of the defaultUri:
      [code]
      public abstract class JmsTransportUtils {
      .......
      private static final Pattern REPLY_TO_NAME_PATTERN = Pattern.compile("replyToName=(
      w+)");
      .......
      }
      [/code]
      strips everything behind the "jms" part of the JNDI name.

      To do a quick fix, I've externalized the JmsTransportUtils class and changed the REPLY_TO_NAME_PATTERN to be similar to the DESTINATION_NAME_PATTERN:
      [code]
      public abstract class JmsTransportUtils {
      .......
      private static final Pattern REPLY_TO_NAME_PATTERN = Pattern.compile("replyToName=([^\\?]+)");
      .......
      }
      [/code]

        Activity

        miha Mihael Sedmak created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 1.5.5 [ 11067 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        13d 9h 56m 1 Arjen Poutsma 20/Aug/08 4:23 AM
        In Progress In Progress Resolved Resolved
        8d 1h 4m 1 Arjen Poutsma 28/Aug/08 5:27 AM
        Resolved Resolved Closed Closed
        1345d 1h 35m 1 Arjen Poutsma 04/May/12 7:03 AM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            miha Mihael Sedmak
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: