Hi Guys,

 

I get the below error when i try to deploy my Java Web Application application in Jboss 5.0.1 with Oracle Database 9i and JDK 1.6

 

Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: comp not bound

 

I referred all over the internet and I coouldnt find a concrete solution, but wherever i saw they suggested there is some issue with my Oracle Datasource configuration.

 

I have pasted all the configuration changes that I made for Datasource below, please suggest me what is that I am doing wrong !!!!!!!!

 

1. oracle-ds.xml

 

<datasources>

  <local-tx-datasource>

    <jndi-name>my_ds</jndi-name>

    <connection-url>jdbc:oracle:thin:@myserver:port:sid</connection-url>

    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

    <user-name>username</user-name>

    <password>password</password>

    <min-pool-size>5</min-pool-size>

    <max-pool-size>50</max-pool-size>

    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

     <metadata>

         <type-mapping>Oracle9i</type-mapping>

      </metadata>

  </local-tx-datasource>

</datasources>

 

2. jboss-web.xml

 

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

<jboss-web>

    <resource-ref>

        <res-ref-name>my_ds</res-ref-name>

        <res-type>oracle.jdbc.pool.OracleDataSource</res-type>

        <jndi-name>java:/my_ds</jndi-name>

    </resource-ref>

</jboss-web>

 

3. web.xml

 

<resource-ref>

        <description>My Data Source</description>

        <res-ref-name>my_ds</res-ref-name>

        <res-type>oracle.jdbc.pool.OracleDataSource</res-type>

        <res-auth>Container</res-auth>

    </resource-ref>

 

I try to utilize this connection in my application from Spring applicationContext file as below

 

4. applicationContextr.xml

 

     <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">

         <property name="jndiName" value="java:comp/env/my_ds"/> 

    </bean>