tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12
Date Thu, 16 Aug 2007 16:09:53 GMT
In my experience, a resource is usually only relevant to one webapp.  
There's no need to put it in server.xml as a GlobalNamingResource unless 
you want that resource available in all your webapps.  Moving the 
resource to the <Context> block of a context.xml file also makes it so 
resources can come and go with deployment of an individual webapp 
without restarting tomcat and disrupting all the webapps.

Developers could define their Resources in the <GlobalNamingResources> 
... </GlobalNamingResources> block of server.xml and then add a 
<ResourceLink> element to the context.xml file.  That'll get you out of 
having database specific information in the <Context ..../> element.  
See this page for further details on that:


Matthew Kerle wrote:

> Hi David
> David Smith wrote:
>> My only editorial comment on the page is to NOT place your 
>> <Resource.../> or <Context .../> definition in server.xml as 
>> recommended on the page.  Place it in context.xml or myapp.xml as I 
>> describe above.
> Just quickly, I was wondering why you recommend this? I know the 
> tomcat docs have changed to reflect the deprecation of defining the 
> <Resource.../> or <Context .../> definition in server.xml, but I never 
> understood why, and personally doing things that way is a serious pain 
> for me since it means I need to build a separate deployment descriptor 
> for dev, test & prod, which means I need to know the prod database 
> details. which I don't want.
> Is there a better way that the sysadmin can setup a JNDI datasource so 
> that deployed war's don't have to contain database-specific details? 
> the only way I've seen so far is to configure that in the server.xml...
> cheers!

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message