Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web app which Tomcat says it has deployed, but when I go to its URL, I get a 404.

The war file is called sonar.war, and is deployed in WebApps. I can see in the logs that it is deploying (also by the fact that it will recreate its database tables if I drop all the tables and restart Tomcat), and by using JConsole I can see that it is in Mbeans->Catalina->Host->Localhost->Attributes->children as a webmodule.

Also on the same machine is hudson.war, which works fine - I am certain that I am connecting to the correct machine because I can remove the hudson.war and Hudson disappears from the URL.

There is nothing in the logs; I have tried changing the log level to include more information, but I still see nothing.

Any ideas/suggestions? I am happy to attach a debugger to the Tomcat instance if necessary in order to try and work out what is happening, but I'm not sure what the entry point is, so pointers to where I might want to stick a breakpoint would also be appreciated.

I am using Tomcat 6, and there is nothing in front of Tomcat (such as Apache).

share|improve this question
does it show as deployed in the tomcat manager...localhost:8080/manager/html – Berek Bryan Nov 23 '10 at 14:44
The manager itself isn't on this Tomcat any more - we removed it - hence the use of JConsole – Rich Nov 23 '10 at 14:54
Check the path under <Context... in web.xml . If it is different than the war file name, try accesing it using whatever is as your context path – ccheneson Nov 23 '10 at 15:06
There is no <Context in our web.xml - just in case you meant server.xml, there isn't one in there either. – Rich Nov 23 '10 at 15:10
is it showing up as an exploded directory on the file system under webapps? – JoseK Nov 24 '10 at 6:05
up vote 1 down vote accepted

Setup a server with the manager application and deploy the war there. The manager will show you what the URL path it deploys to. You can try that path on your real Tomcat server.

For test deployments, I leave the manager application installed so that problems like this are easier to resolve. The application could also be deploying, but having other problems causing it problems binding to its context.

share|improve this answer
I've accepted your comments because it's what I'll do if this ever happens again. This time around though, I gave up and reinstalled from scratch (which took me 10 minutes, compared with the 8 hours I'd wasted trying to get the previous installation working <sob/>) – Rich Nov 24 '10 at 8:51

Now that the pressure is off, I have been able to do a bit of investigation. The following files were missing from the CATALINA_HOME/conf folder:

  • web.xml
  • context.xml

I assume that Sonar's configuration meant that Tomcat didn't cope with these files missing, while Hudson's included this information elsewhere.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.