Deploying a WAR file gives me a 404 Status Code on Tomcat? Deploying a WAR file gives me a 404 Status Code on Tomcat? java java

Deploying a WAR file gives me a 404 Status Code on Tomcat?


Assuming that you have full privileges with the Tomcat installation, try going to http://localhost:8080/manager/html/, if you don't know the password to get into that area, look for the tomcat-users.xml file in your ${tomcat-installation}/conf directory, and that should have it. If it has no entries in it then you will want to add an entry like the following to it:

<user username="username" password="password" roles="admin,manager" />

See whether your application shows up in that screen, and if it does, click on the link and see if that gets you anywhere. If it doesn't, then I suggest following ifishers's advice, and looking at the log files to see if it lists any errors.

But long story short, most likely something is screwed up with your project's web.xml


In more recent times, this condition might occur if JAVA_HOME points to an earlier version of Java than the code in the WAR. Tomcat might use JAVA_HOME to determine JRE_HOME it shows after running startup.bat in Tomcat's BIN directory. While Tomcat may be happy itself with the Java version it gets, for the application this might not be sufficient. In my case, Tomcat 8.0.49 was running alright with JDK1.7, while the application was not initializing at all (yes, it was a Spring Boot application, WAR was being unpacked, but that's all) - without giving any errors. After setting JAVA_HOME to the location of JDK1.8, the problem was solved.


I have the same problem.My problem is my application name and war file name are different.I have change war file name to my application name.

Here, when your application is deployed tomcat automatically extract your war file with same name. In my case my service name is my-web-service(i.e.https://localhost:8080/my-web-service/) and my war file name is MY-java-connector-0.0.1-SNAPSHOT.war(this is my project folder name). Now tomcat is looking for my-web=service folder and it finds epicor-java-connector-0.0.1-SNAPSHOT folder. so rename the folder to my-web=service.war and it is working.