I am creating a client for a service which uses JMS, the service element of the 
wsdl I am working with looks like this:

    <service name="DemoService">
    <!-- begin jms specific config -->
           <port binding="tns:DemoServiceBinding" name="DemoService">
               <jms:address
                   destinationStyle="queue"
                   jndiConnectionFactoryName="DemoQueueConnectionFactory"
                   connectionUserName="username"
                   connectionPassword="password"
                   jndiDestinationName="Q.IN"
                   jndiReplyDestinationName="Q.OUT">

                   <jms:JMSNamingProperty name="java.naming.factory.initial" 
value="com.tibco.tibjms.naming.TibjmsInitialContextFactory"/>
                   <jms:JMSNamingProperty name="java.naming.provider.url" 
value="tcp://localhost:7222"/>
                   <jms:JMSNamingProperty name="java.naming.security.principal" 
value="username"/>
                   <jms:JMSNamingProperty 
name="java.naming.security.credentials" value="password"/>
              </jms:address>
              <jms:clientConfig useConduitIdSelector="false"/>
           </port>
    </service>

Notice that I have username and password for both the jndi lookup and the JMS 
connection factory.  The jndi password is fine, but the JMS password is not:

org.springframework.jms.JmsSecurityException: invalid name or password; nested 
exception is javax.jms.JMSSecurityException: invalid name or password
        at 
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:291)
        at 
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
....
        at 
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:150)
        at 
org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:342)
        at 
org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:288)
        at 
org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:225)
        at 
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
        at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)
        ... 15 more

Debugging this, I found the following in JMSOldConfigHolder:

        if (address.isSetConnectionUserName()) {
            endpoint.setUsername(address.getConnectionUserName());
        }
        if (address.isSetConnectionPassword()) {
            endpoint.setPassword(address.getConnectionUserName());
        }

which sets the username in the password field of the endpoint.  This is in CXF 
2.3.4.

My questions is:  is there another way to configure a client to a service using 
JMS through some combination of wsdl and xml which will allow me to pass both 
username/password pairs?  Regardless, I am willing to submit a patch for this 
issue if there is any desire for it.

Regards,
Chris Pike


This email and any attachments may contain information which is confidential 
and/or privileged. The information is intended exclusively for the addressee 
and the views expressed may not be official policy, but the personal views of 
the originator. If you are not the intended recipient, be aware that any 
disclosure, copying, distribution or use of the contents is prohibited. If you 
have received this email and any file transmitted with it in error, please 
notify the sender by telephone or return email immediately and delete the 
material from your computer. Internet communications are not secure and Lab49 
is not responsible for their abuse by third parties, nor for any alteration or 
corruption in transmission, nor for any damage or loss caused by any virus or 
other defect. Lab49 accepts no liability or responsibility arising out of or in 
any way connected to this email.

Reply via email to