I have taken over a project and I am trying to follow the documentation left to me by the old developers but it seems to be unclear.
I have installed Tomcat version 9.0.90 and Java 8 on my system. When I hit http://localhost:8080/, I can see the default Tomcat homepage. But when I try to go to my project URL, I get a 404 page not found error.
I have gone through the official documentation to see if there is any issue in the way the folder structure is organized but there seem to be no problems there.
The instructions in the documentation left by the old developers ask me to generate a war file and then copy this war file under $TOMCAT_HOME/webapps
.
After copying the war file in webapps, it gets extracted into a folder structure as follows (This is a shortened version of my entire project folder which is huge and has a lot of other files and classes)
[Project-Folder]
├──WEB-INF
├── classes
│ ├── servlet
│ │ ├── .... other classes
│ │ ├── SimStudentBaseServlet.class
└── web.xml
├── Other directories
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://JAVA.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<display-name>SimStudentBaseServlet</display-name>
<servlet-name>SimStudentBaseServlet</servlet-name>
<servlet-class>servlet.SimStudentBaseServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SimStudentBaseServlet</servlet-name>
<url-pattern>/service</url-pattern>
</servlet-mapping>
<listener>
<listener-class>servlet.SimStudentBaseServlet</listener-class>
</listener>
</web-app>
I am tring to hit the URL http://localhost:8080/service
which should open up a web page but I am getting a 404 page instead.