2

I'm using tomcat manager to deploy my war files. To update a war I use the following url:

http://localhost:8080/manager/deploy?path=/example&war=file:/path/example.war&update=true

The problem is that using this, the xml with the configuration (under Catalina/localhost/example.xml), is erased.

How can I preserve it?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Mateu
  • 2,636
  • 6
  • 36
  • 54

1 Answers1

0

Place your configuration in your webapp's META-INF/context.xml and tomcat will take care of the rest.

cherouvim
  • 31,725
  • 15
  • 104
  • 153
  • I did not know that option, but it is no feasible, cause I use the same war in different servers, which need diferent configuration. – Mateu Feb 09 '11 at 15:16
  • If your build process supports it you can have many context.xml for the many target servers. Another option is to place the context.xml declarations statically inside the server.xml. I highly suggest trying out the first option though. – cherouvim Feb 09 '11 at 15:44
  • That was not what I was expecting, but I suppose that there is no other way. Thanks! – Mateu Feb 10 '11 at 14:51
  • In my opinion, the usuall use case of updating a war, is deploy it and mantain the configuration that was created before. I don't see why the xml is erased. In my particular case I can't use the context.xml because I need to share war between servers. So the only solution I see is using server.xml, but I think that using the single xml is quite more clean. – Mateu Feb 10 '11 at 18:15