1 Reply Latest reply on May 15, 2008 11:58 AM by Roger Hsu

    Unable to lookup datasource in jboss 4.2.2 with spring 2.0.8

    null null Newbie

      ello,

      I have trying to use the datasource in my JBoss 4.2.2 server, but I am getting the error below. I have tried a number of permutations on the jndi name in the applicationcontext.xml file, but none seem to work.

      Any suggestions would be greatly appreciated.

      My jboss xxxDS.xml file look like:

      <local-tx-datasource>
       <jndi-name>oracleDS</jndi-name>


      My applicationcontext.xml has the following value:

      <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiName">oracleDS</property>
      
      </bean>
      


      I have also tried:
      java:OracleDS
      java:/oracleDS

      All of them result in the following exception:

      org.springframework.beans.factory.BeanCreationException: Error creating
      bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: oracleDS not bound
      Caused by:
      javax.naming.NameNotFoundException: oracleDS not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java