1
votes

I currently have a working servlet created in Eclipse. When running it from the Tomcat plugin, everything works, and my app shows up at localhost:8080/project_name/. However, when I package the project into a .war file and place it in the /webapps directory of Tomcat and start the server, the servlet cannot be accessed. In Terminal, I can see Tomcat loading my project, and a temporary folder of the unarchived project is also created in /webapps. However, I simply cannot access my servlet.

Note: I'm using Tomcat 7 and I don't have a web.xml file in my project.

1
Your URL should be localhost:8080/project_name/Servlet_Path. - Masudul
I have a Servlet mapped to "localhost:8080/project_name/" with the annotation WebServlet(""), but that doesn't work. Furthermore, where is the project name stored? - michael99man
In tomcat 7, project is stored at webapps directory. You should use IDE integrated tomcat server to see what is happend and run project from IDE. - Masudul

1 Answers

1
votes

How are you creating the war file? Check if your war files contain jar files under WEB-INF/lib folder and if the class files are not missing. You can easily verify it under tomcat/webapps/[project name] folder.