iconfu iconfu iconfu is the world's largest collection of free, open-source icons and it comes with a handy image editor, so you can tweak icons to suit your needs exactly or even draw your own from scratch
invert blue resize move up verbose drawmode lighter previews remove swap animator library library draw shift up make a copy large editor explorer your icon contract agreement tag

06 March 2008

Tomcat Deploys My Application Twice !

I drop my foo.war under webapps, and from the logs I see objects from my Spring application context getting loaded two times. What's causing this double deployment?

After much head-scratching I realised that my foo app was getting deployed as the root context (under "/"), as well as under "/foo". And in our Tomcat's server.xml we had a little

  <Context path=""
              docBase="/path_to_tomcat/webapps/foo"
              reloadable="true" 
              crossContext="true"> 
  </Context>

We dumped this Context entry, renamed foo.war to ROOT.war (caps necessary), and our double application startup disappeared.

Tomcat was dutifully doing its auto-deploy magic with its webapps directory, and then dutifully deploying any Contexts it found in its server.xml. If you really need a Context in your server.xml, make sure its docBase isn't under your Tomcat's webapps directory.

A simple solution, but it took us a while to fix, and according to my friend google lots of other people have had similar symptoms and worse trouble fixing them.

HTH :))

0 comments:

Post a Comment