1 Reply Latest reply on Aug 27, 2003 1:04 PM by Adrian Brock

    Jboss 3.2.1 + Oracle8

    sise Newbie

      Hi everybody.

      I try to connect my app-server with a database in oracle. But I receive every time this Failure.

      "javax.naming.NameNotFoundException: env not bound"

      I need really help, help, help. Because since 4 weeks I try to solve this Problem, but this make me crazy..

      I configure my web-app so that , in META-INF reside the jboss-web.xml

      it look like this

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "C:/jboss-3.2.2RC1_tomcat-4.1.24/docs/dtd/jboss-web_3_2.dtd">
      <jboss-web>
      <resource-ref>

      <res-ref-name>jdbc/dsMIT</res-ref-name>
      <!-- Original-Schreibweise -->
      <!--jndi-name>java:/jdbc/dsMIT</jndi-name-->
      <!-- heute 25 August 2003 -->

      <jndi-name>java:/OracleDS</jndi-name>
      </resource-ref>
      </jboss-web>

      and in WEB_INF resides the web.xml and looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- xml version="1.0" encoding="Cp1252" -->
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "C:/jboss-3.2.2RC1_tomcat-4.1.24/docs/dtd/web-app_2_2.dtd">

      <web-app>
      <display-name>MIT</display-name>
      MIT

      <session-config>
      <session-timeout>1800</session-timeout>
      </session-config>

      <mime-mapping>
      txt
      <mime-type>text/plain</mime-type>
      </mime-mapping>

      <mime-mapping>
      html
      <mime-type>text/html</mime-type>
      </mime-mapping>

      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      <resource-ref>
      DB Connection to MIT data
      <res-ref-name>jdbc/dsMIT</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      </web-app>

      and my oracle configuration file looks lihe this:

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->

      <!-- $Id: oracle-ds.xml,v 1.1.2.2 2003/04/01 04:51:12 d_jencks Exp $ -->
      <!-- ==================================================================== -->
      <!-- Datasource config for Oracle originally from Steven Coy -->
      <!-- ==================================================================== -->



      <local-tx-datasource>
      <!-- Original -->
      <!--jndi-name>jdbc/dsMIT</jndi-name-->
      <!-- Heute 22 August 20003 -->

      <jndi-name>OracleDS</jndi-name>


      <connection-url>jdbc:oracle:thin:@pinky.keller:1521:orcl</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>xt</user-name>
      y
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>



      and my testprogram looks like this :


      DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/dsMIT");



      Thanks u for advance.....