tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikolaj Rydzewski <>
Subject How to create global resources on the fly?
Date Mon, 04 Dec 2006 15:53:16 GMT

There's one thing I don't like in Tomcat: I have to edit server.xml file 
to add new global resources (i.e. data ource definition). It's not a big 
problem on a production, one doesn't change such things often. But on 
developement server it's quite annoing.

I don't want to put datasource definition inside META-INF/context.xml. 
There's already resourceLink there (in my case). Sure, I could have two 
versions of context.xml, one for production and the other for dev, 
but... but I dont't want to change that ;-)

I'd like to be able to: place a small xml file (i.e. resource 
definition, exactly like in the server.xml) in some directory watched by 
Tomcat, and Tomcat to 'deploy' it (create a datasource, mail session, 
etc). Just like it do with resource elements. I think that JBoss has 
that feature, but it's too heavy for my needs.

I have tried and it is possible to create new datasources via JMX, 
without restarting Tomcat.

Is there such a tool or I have to write it? ;-)

There're some promising entries in the server.xml file:
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
className="org.apache.catalina.mbeans.ServerLifecycleListener" />
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

What do you think?

Mikolaj Rydzewski <>

View raw message