Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat reporting 404 error on all of newly deployed WAR files?

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.

like image 751
dacracot Avatar asked Jun 10 '10 17:06

dacracot


People also ask

How do I fix error 404 in Tomcat?

This error indicates that the server could not find the desired resource. This resource can be any file such as JSP, HTML, or image resource. Usually, the resource is present, but it is referenced incorrectly. In most cases, you can fix this by correcting the URL.

How is it resolved Apache Tomcat HTTP Status 404 error?

The URL is not handled by any Java servlets If the request URL is /view_books the server will raise HTTP 404 error. You can fix by either correcting the URL or correcting the URL mapping in the @WebServlet annotation.

Why my WAR file is not deployed in Tomcat?

Try stopping Tomcat, deleting the war and matching folder, copying the new war in, then starting Tomcat. If it works then, the problem might be left over files. (I have an app for example that doesn't completely clean itself up). (3) The app might not be initializing properly due to issues with the app.


1 Answers

You should go to the "Servers" tab and click-right on the "properties" and press the button "Switch Location". After that you make the test again. Let me know if it works. (Reference: 404 with tomcat / eclipse deployed webapp).

like image 168
Marcos Tadeu Avatar answered Oct 18 '22 03:10

Marcos Tadeu