views:

217

answers:

1

I deployed a WAR file into $TOMCAT_HOME/webapps by copying the file into the directory, just like I've done a thousand times before. Tomcat detects the WAR and inflates it. I can traverse the directory tree on my server at the command line (it's Fedora).

But when I address the webapp within my client machine's browser, I get nothing but 404 errors. This has happened to the last two deployments of completely separate WARs.

The first was a replacement of an existing WAR. I first deleted the WAR and its inflated directory, and then copied in the WAR which inflated... 404. I deleted everything again, put back the previously working WAR from backup. It inflated and worked.

The second was a completely new, never before deployed WAR... nothing but 404.

Other WARs are working, but now I'm afraid to change anything until I know what is going on. Any clues?


Edit: From my comment you can see that the logs included "SEVERE: Error listenerStart" after the WAR was deployed by Tomcat. There were no stack traces or other errors reported.


Edit2: Turns out the second WAR was looking for the ELResolver and could not find it. This was buried in the localhost log file.

A: 

If a web application does not deploy correctly you will get 404's.

You should just remove the WAR file, and let Tomcat delete the inflated war folder itself.

The ListenerError could be that the web.xml still refers to a listener, which is not in the new code you want to put in the war.

Thorbjørn Ravn Andersen