« Return to Thread: JNDI NameNotFoundException on BTM 1.3-RC2

Re: JNDI NameNotFoundException on BTM 1.3-RC2

by Ludovic Orban :: Rate this Message:

Reply to Author | View in Thread

Could you please include the complete stack trace of the BeanCreationException ? Without it I cannot say for sure what the problem is so I'm going to guess here.

There is nothing in BTM that makes it install its JNDI provider as the default context so you should set the JNDI environment on the JndiObjectFactoryBean:

<bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:activemq/QueueConnectionFactory" />
        <property name="jndiEnvironment">
                <props>
                        <prop key="java.naming.factory.initial">bitronix.tm.jndi.BitronixInitialContextFactory</prop>
                </props>
        </property>
</bean>

and I also wonder, since the lookup to the default context threw a NameNotFoundException, it looks like you already have a default context that might be configured to intercept lookups in the java: namespace.

I suggest you to drop the java: prefix of your resource's unique name as the JNDI provider of BTM isn't a full-blown one and that could cause complex lookup issues due to JNDI's architecture.

Ludovic

 « Return to Thread: JNDI NameNotFoundException on BTM 1.3-RC2