Re: Trouble using JNDI with Tomcat and Oracle

From: Allen Chesley (allen012_at_attbi.com)
Date: 02/11/04


Date: Wed, 11 Feb 2004 04:06:10 GMT

1. Make sure that the JAR file with the Oracle driver is in
$CATALINA_HOME/common/lib and no where else.

2. Make sure your context XML file has naming set to "true" (or not set
to "false". The context cannot use JNDI to look up the JDBC reference
unless the "use naming" parameter is true.

On Sun, 08 Feb 2004 15:22:05 -0800, Kiran wrote:

> Hi,
> I am using Tomcat5 and Oracle 9i and having trouble trying to connect to
> my database using JNDI.
>
> The Context tag in server.xml looks like this.
>
> <Context path="" docBase="ROOT" debug="1">
> <Resource name="jdbc/costanza" auth="Container"
> type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/costanza">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>scott</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>tiger</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>oracle.jdbc.driver.OracleDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:oracle:thin@127.0.0.1:1521:costanza</value>
> </parameter>
> </ResourceParams>
> </Context>
>
> and the relevant portion in web.xml looks like this <resource-ref>
> <description>Accounts Database</description>
> <res-ref-name>jdbc/costanza</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> The SID of my database is costanza and I am able to connect to it using
> DriverManager. But when I use JNDI, I get the following error.
>
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
> class '' for connect URL 'null', cause: No suitable driver
>
> It appears as if it's not reading the driverClassName and url tags. I get
> the same error when I remove the whole Context section from server.xml.
>
> I am struggling to solve this problem. Can anyone please help?
>
> Thanks in advance.
> -Kiran



Relevant Pages

  • Re: User vs. Worker threads
    ... is shut down or the thread terminates itself by calling ... Driver routines that run in a process context other than that of the system ... It has all the worker threads. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Question about FILE_OBJECT
    ... I think your missing something First the driver is an ndis intermediate ... I.E. every time they allocated a new context object they ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Problem with matching kind of NDIS driver.
    ... When it comes to outgoing packets, the reasons why his task is infeasible ... context of different threads. ... NDIS IM filter that is located immediately below ... We are telling you that in a NDIS Intermediate driver the process ...
    (microsoft.public.development.device.drivers)
  • Re: Question about FILE_OBJECT
    ... NDIS IM is a driver that fully conforms to the model, ... I.E. every time they allocated a new context object they ...
    (microsoft.public.win32.programmer.kernel)
  • Re: User vs. Worker threads
    ... Use the NtCurrentProcessmacro to specify the ... Driver routines that run in a process context other than that of the system ... It has all the worker threads. ...
    (microsoft.public.win32.programmer.kernel)