7 Replies Latest reply on Aug 7, 2006 9:09 AM by Paul Anderson

    Complicated DataSouce and JNDI javax.naming.NamingException:

    Paul Anderson Newbie

      My oracle-ds.xml is:

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

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

      <!-- $Id: oracle-ds.xml,v 1.6 2004/09/15 14:37:40 loubyansky Exp $ -->
      <!-- ==================================================================== -->
      <!-- Datasource config for Oracle originally from Steven Coy -->
      <!-- ==================================================================== -->



      <local-tx-datasource>
      <jndi-name>DCDEV</jndi-name>
      <!--
      Here are a couple of the possible OCI configurations.
      For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm

      <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
      or
      <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>

      Clearly, its better to have TNS set up properly.
      -->
      <connection-url>jdbc:oracle:thin:@d2.corp.company.net:1521:DCDEV</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>test</user-name>
      test

      <!--pooling parameters-->
      <min-pool-size>10</min-pool-size>
      <max-pool-size>30</max-pool-size>

      <!-- This element specifies the maximum time in milliseconds to block while waiting for a connection before throwing an exception. -->
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      <!-- This element specifies the maximum time in minutes a connection may be idle before being closed. -->
      <idle-timeout-minutes>15</idle-timeout-minutes>

      <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
      <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
      <!-- Checks the Oracle error codes and messages for fatal errors -->
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <!-- sql to call when connection is created
      <new-connection-sql>some arbitrary sql</new-connection-sql>
      -->

      <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
      <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
      -->

      <!-- This element specifies the number of prepared statements per connection in an LRU cache, which is keyed by the SQL query. Setting this to zero disables the cache. -->
      <prepared-statement-cache-size>15</prepared-statement-cache-size>

      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

      <type-mapping>Oracle10i</type-mapping>

      </local-tx-datasource>




      My WEB-INF/web.xml is:

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <web-app version="2.4"
      xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd">

      <!-- The Welcome File List -->
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      <resource-ref>
      Data Compilation DataSource
      <res-ref-name>DCDEV</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      </web-app>


      My WEB-INF/jboss-web.xml is:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <!-- Uncomment the security-domain to enable security. You will
      need to edit the htmladaptor login configuration to setup the
      login modules used to authentication users.
      <security-domain>java:/jaas/jmx-console</Dsecurity-domain>
      -->

      <reference-ref>
      <res-ref-name>DCDEV</res-ref-name>
      <jndi-name>java:/DCDEV</jndi-name>
      </reference-ref>

      </jboss-web>


      My question is why am I getting the following exception when jboss 4.0.4 is restarted or when I redeploy the application:

      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: DCDEV has no valid JNDI binding. Check the jboss-web/resource-ref.)

      NOTE: The application is an exploded(unpacked) format. Not sure if i'm using the correct technical wording.