camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lsclark <>
Subject How to set user/password on connection created from JNDI lookup ConnectionFactory
Date Mon, 23 Jun 2008 21:47:44 GMT

I am attempting to create a durable subscription to a topic on a JBoss
Messaging broker.  I have a JMSComponent configured via spring and am using
this component as an endpoint in a route.  I am looking up the
ConnectionFactory via JNDI.

What I can't figure out how to do is the configuration in camel for passing
in a username and password to be used by the connection factory when it
obtains a connection.  I have tried a number of things, and searched around
a bit, but haven't found anyone that has run into this particular issue. 
The current configuration produces the exception: 

 ERROR [org.springframework.jms.listener.DefaultMessageListenerContainer]
Setup of JMS message listener invoker failed - trying to recover
javax.jms.JMSSecurityException: User: null is not authorized to create
durable sub on destination testTopic

Any help or leads would be appreciated!

Spring configuration:

<bean id="jmsProvider" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="destinationResolver" ref="jmsDestinationResolver" />
    <property name="deliveryPersistent" value="true" />
    <property name="timeToLive" value="0" />
    <property name="clientId" value="DurableSubscriberExample" />       
<bean id="jmsDestinationResolver"
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="cache" value="true" />

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
            <prop key="brokerURL">${jms.jndiProviderUrl}</prop>
<bean id="jmsConnectionFactory"
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName">
<bean id="testProcessor" class="com.test.TestProcessor"/>

Route DSL:

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message