Skip to content
Advertisement

Java servlets on Tomcat take to 404 error but it works fine on localhost

I have design a webApp with NetBeans IDE. It works fine on localhost, but when I deploy it on my host, trying to access the servlets give me a 404 error.

My servlet dos include the URLpattern and the Name specifications, like this

JavaScript

The servlet just does a “redirection” to a .jsp

JavaScript

If I use the URL www.mysite/faq.jsp it works ok, but it doesn’t when I try the servlet www.mysite/faq (even it does on localhost, as I said).

I have checked the .class files are compiled and included on the WEB-INF folder and it doesn’t seme to be the problem.

Also I tried to add the web.xml description of the servlet like below, but it doesn’t work either.

JavaScript

I don’t know waht could be my problem and it may be a very stupid thing, but I can’t find it.

Thank you all.

Advertisement

Answer

SOLVED:

As I said, it should be a simple thing. The hosting server was configurated on Tomcat 10x and JDK 10, while my project was build on jdk 8 and tomcat 7. The solution was to ask for the hosting provider and change the server configuration to fit my project.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement