tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme BATON <>
Subject RE: How to make Tomcat write its server config to server.xml ...
Date Tue, 12 Oct 2004 13:53:45 GMT

Hi Krist,

You found the way, it is using the "commit changes" class, a Struts Action.

To get the MBeanServer from your class, use the following (deprecated) code

And then send the same commands that the Action class (look in the source code).

As you'll need to have Tomcat running, you should do it in an access-protected page that you
would access from an httpclient class used at the command line

If you look at a recent post of mine, you'll see I have some trouble with the MBeanServer,
it's not a trivial object. 
Good luck



-----Message d'origine-----
De : Krist van Besien [] 
Envoyé : mardi 12 octobre 2004 11:21
À :
Objet : How to make Tomcat write its server config to server.xml ...

Hello all,
(This is a repost, as I had no anwers last time. I still hope there is an answer though, as
this issue just bit me again).

Around here we install webapps in non standard locations from the command line.
We do this by creating an .xml that contains all that tomcat (ver 4.1.27) needs to know about
a new context and then do:

get --http-user="admin" --http-passwd="*****" -O- \ http://localhost:8080/manager/install?config=file:/data/myapp/conf/myapp.xml

This installs the context just fine, everything works.

Just one problem remains. The new context is not added to the server.xml. I need to get in
to a browser, log on to the admin application, and then press "commit changes". If I don't
do that Tomcat forgets all about the new context after the next restart.

Is there way to tell Tomcat to write any changes to the running config back to the server.xml,
_from the command line_ ?



Krist van Besien                                       Bern, Switzerland

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message