activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boday <ben.o...@initekconsulting.com>
Subject Spring JNDI datasource not recognized after upgrade to ActiveMQ 5.6.0
Date Mon, 01 Oct 2012 17:08:55 GMT
I tested my ActiveMQ 5.5.0 (fuse version) app in AMQ 5.6.0 and noticed that
our Spring JNDI configured Oracle datasources aren't being found.

The only thing I changed in my applications was the pom.xml versions of
AMQ/Spring (to match the 5.6 versions). Otherwise, I'm using the identical
application code and configuration (activemq.xml, jndi.xml, etc), but my
Spring JDBC DAOs (v3.0.5) are failing to find them.

No errors in the logs otherwise, just this Spring Application Context
initialization error...

javax.naming.NameNotFoundException; remaining name 'jdbc/myDataSource'

here is the relevant Spring jndi config (conf/jndi.xml, included in
conf/activemq.xml)...

<bean id="jndi"
class="org.apache.xbean.spring.jndi.SpringInitialContextFactory" 
    factory-method="makeInitialContext" scope="singleton">
    <property name="entries" ref="jndiEntries" />
</bean>
<util:map id="jndiEntries">
    <entry key="jdbc/myDataSource">
    <bean id="myDBCPDataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="oracle.jdbc.OracleDriver" />
        ...

then my application references it like this...

<bean id="myDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName">
        <value>jdbc/myDataSource</value>
    </property>
</bean>

<bean id="messageDAO" class="com.mycompany.MessageDAOImpl">
    <property name="dataSource" ref="myDataSource" />
</bean>

That said, I tested without using JNDI (instead just hardcoded the
datasource in my app) and everything works as expected. So that should rule
out everything except the Spring JNDI registration/lookup of the datasource,
etc.

So, what am I missing?

note: also on
http://stackoverflow.com/questions/11748318/spring-jndi-datasource-not-recognized-after-upgrade-to-activemq-5-6-0



--
View this message in context: http://activemq.2283324.n4.nabble.com/Spring-JNDI-datasource-not-recognized-after-upgrade-to-ActiveMQ-5-6-0-tp4657289.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message