Thanks.
Now I have corrected that. Still no change - the DataSource retrieved is
null.
George Coles
-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Thursday, February 14, 2002 4:56 PM
To: Tomcat Users List; gcoles@silverstream.com
Subject: Re: null DataSource when trying to get JNDI InitialContext
On Thu, 14 Feb 2002, George M. Coles wrote:
> Date: Thu, 14 Feb 2002 15:53:17 -0500
> From: George M. Coles <gcoles@silverstream.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>,
> gcoles@silverstream.com
> To: tomcat-user@jakarta.apache.org
> Subject: null DataSource when trying to get JNDI InitialContext
>
> Hi all,
> I am using tomcat for the firs time. I have v. 4.02, using jdk 1.4.
>
> I am attempting to deploy my app, which uses JNDI to look up a connection
> for its data access. I am using DB2 I have placed the db2 jdbc zip file
in
> my WEB-INF/libs dir. My server.xml looks like this:
>
> <Context path="/pl" docBase="E:/projects/fa/fa" debug="5"
> privileged="true">
> <Resource name="jdbc/PATHLINE" auth="Container"
> type="javax.sql.DataSource" description="Pathline Database">
> <ResourceParams name="jdbc/PATHLINE">
> <parameter>
> <name>driverClassName</name>
> <value>COM/ibm/db2/jdbc/app/DB2Driver</value>
> </parameter>
> <parameter>
> <name>driverName</name>
> <value>jdbc:db2:PATHLINE</value>
> </parameter>
> <parameter>
> <name>user</name>
> <value>db2admin</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>password</value>
> </parameter>
> </ResourceParams>
> </Resource>
> </Context>
>
>
> When I do my context lookup, which should return a DataSource, the
> DataSource is null. I do not, however, get a naming exception, as I would
> expect if the resource could not be found.
>
> Has anyone had a similar experience? I am not quite knowlegeable enough
> about JNDI or Tomcat to see where my problem is.
>
> thanks,
> George Coles
>
The <ResourceParams> element should *not* be nested inside the <Resource>
element. Instead, it should *follow* <Resource> at the same level.
<Context path="..." ...>
<Resource name="..." .../>
<ResourceParams name="...">
... parameter elements ...
</ResourceParams>
</Context>
Craig
--
To unsubscribe: <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
|