5 Replies Latest reply on Sep 4, 2002 4:57 AM by kkjvk12

    When I try to get the datasource from JNDI using the lookup

    kkjvk12 Newbie

      I have a session bean and I want to get the default OracleDS datasource to perform some database stuff with it.

      When I try to get the datasource from JNDI using the lookup name
      "java:comp/env/jdbc/OracleDS", I have the following error message:

      javax.naming.NameNotFoundException: OracleDS not bound



      I cannot see what is wrong with my ejb-jar.xml and JBoss.xml and Client.java files:

      //Client.java
      ctx.lookup("jdbc/OracleDS");
      or
      ctx.lookup("java:comp/env/jdbc/OracleDS");


      //jboss.xml


      false
      <container-configurations></container-configurations>
      <resource-managers>
      <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
      <res-name>OracleDS</res-name>
      <res-jndi-name>java:/OracleDS</res-jndi-name>
      </resource-manager>
      </resource-managers>

      <enterprise-beans>

      <ejb-name>UIDHighKeyGeneratorHome</ejb-name>
      <jndi-name>org/ejbutils/uid/UIDHighKeyGenerator</jndi-name>
      <configuration-name>Standard Stateless
      SessionBean</configuration-name>
      <resource-ref>
      <res-ref-name>jdbc/OracleDS</res-ref-name>
      <resource-name>OracleDS</resource-name>
      </resource-ref>

      </enterprise-beans>


      //ejb-jar.xml

      <ejb-jar>
      <enterprise-beans>

      <ejb-name>UIDHighKeyGeneratorHome</ejb-name>
      org.ejbutils.uid.UIDHighKeyGeneratorHome
      org.ejbutils.uid.UIDHighKeyGenerator
      <ejb-class>org.ejbutils.uid.UIDHighKeyGeneratorBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <resource-ref>
      <res-ref-name>jdbc/OracleDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      </enterprise-beans>

      ...

      </ejb-jar>

      What do I do wrong?