0

I been working on a Spring project that been running great in tomcat, we are moving into JBoss and would like to use the datasource setup in JBoss. The project used to work with the following xml..

<beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
    > <beans:property name="driverClassName" value="${database.driver}" /> <beans:property 
    name="url" value="${database.url}" /> <beans:property name="username" value="${database.user}" 
    /> <beans:property name="password" value="${database.password}" /> <beans:property 
    name="initialSize" value="5" /> <beans:property name="maxActive" value="10" 
    /> </beans:bean>

but now that we are moving to JBoss and the Admin would like us to use the datasource setup in JBoss I am trying to use the following.

<jee:jndi-lookup id="dataSourcejndi" jndi-name="dataSourcejndi"
        lookup-on-startup="false" proxy-interface="javax.sql.DataSource"
        cache="true" resource-ref="true" />

    <beans:bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"
        lazy-init="true">
        <beans:property name="dataSource" ref="dataSourcejndi" />
    </beans:bean>

We are getting no errors but the project will not startup anymore..

SJS
  • 5,607
  • 19
  • 78
  • 105

1 Answers1

0

You should only need the second one. Mine is setup like this:

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
  <property name="jndiName" value="java:My_Data_Source" /> 
</bean>
BenSchro10
  • 326
  • 1
  • 7