2

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).

Rich
  • 1,333
  • 5
  • 27
  • 39

2 Answers2

3

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.

Rich
  • 1,333
  • 5
  • 27
  • 39
1

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.

BillThor
  • 27,354
  • 3
  • 35
  • 69
  • 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 ) – Rich Nov 24 '10 at 08:51