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

    Unable to lookup datasource in jboss 4.2.2 with spring 2.0.8

      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


        • 1. Re: Unable to lookup datasource in jboss 4.2.2 with spring 2
          rogerwbmd

          This is my first week into the JBoss world - I am totally newbie. I have the same problem when I add my seam web project into the jboss server. I just find out I can solve the exception by deploy the datasource xml file [PROJECT_ROOT]\resources\test_ds.xml into the server. I don't know why I need to do this, but it seems working.