Ok, option 2 worked.  If I placed the resource and resourceparams in the
context it worked.  I used the tomcat5 version and modified the web app
default standalone context xml file.

I would like to still understand why the global one did not work or
declaring it in the web.xml file.

-----Original Message-----
From: Richard Calosso [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 3:32 PM
To: 'Tomcat Users List'
Subject: RE: JDBC Source getting null url


I also tried it using a global resource (option 1) with the same error
result.  Built it by hand and used the admin pages, same result.  Since I do
not have a context entry for my app I will try to build one and see if
option 2 works.


-----Original Message-----
From: Sasha Borodin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 2:30 PM
To: Tomcat Users List
Subject: Re: JDBC Source getting null url


Richard,

I believe the first two elements appearing in your web.xml (Resource and
ResourceParams) need to be present in the server configuration:

1. either as a global resource in your server.xml (inside the Server
element)
2. or as a context specific resource in a "context descriptor" - a Context
entry in your server.xml, or (the new way) an external xml file
(http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html)

This way Tomcat knows about and sets up the resource for you web application
to use; I think the only thing you should do in your web.xml is "declare a
need" for a resource, though this part I'm hazy on, as my stuff has always
worked without any mention of the container-managed resource in my
web.xml's.

If anyone can clarify the requirement/logic behind declaring resource
"needs" in web.xml, I'd appreciate it.

-Sasha






From: "Richard Calosso" <[EMAIL PROTECTED]>
Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
Date: Mon, 10 May 2004 14:12:02 -0700
To: "Tomcat Users List (E-mail)" <[EMAIL PROTECTED]>
Subject: JDBC Source getting null url

I just started to try and use a database source for some of my pages in my
web app and am not getting a connection.  I am using Tomcat 5.0.19 with JRE
1.4.2_04 on redhat 9 with mysql.  Every time I try to connect I get a
exception saying Datasource invalid, not suitable driver for class '' url
null (actual error page attached).  I am trying the examples in the docs, I
get the same error in either servlet or jsp page, I have included the jsp
page.  I have everything packaged in the web.xml file of the application to
try and keep it portable.  I also tried using the admin tool and register a
global data source and get the same result.

If I mistype the datasource name in the jsp it says it cannot find it so I
does find some of it to verify, but why does it not find the resource
parameters providing the driver and url?  I tried to google for some
answers, but did not find much that applied to the same versions.

Thanks in advance.

===========
Attached are my web.xml, sqltest.jsp, and the error output


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to