Using JNDI Template in Tomcat I was able to get datasources using the configuration below. Unfortunately now that I am using JBoss I get a javax.naming.Reference instance instead, so the below throws an error. Any idea how to get the DataSource identified by the Reference?
Code:<bean id="jndiAccessor" abstract="true"> <property name="jndiTemplate"> <bean class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="location" value="classpath:jndi.properties" /> </bean> </property> </bean> </property> <property name="resourceRef" value="true" /> </bean> <bean id="dataSource" parent="jndiAccessor" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/MyDS" /> </bean>


Reply With Quote