tomcat server at localhost failed to start



So, while Im working with MVC JSTL, I tried to create some servlets and map them to some JSP forms by using web.xml and I got this error:



Server Tomcat v7.0 Server at localhost failed to start


I searched for the solution for hours and followed some advises from here. Deleted some files as suggested, even deleted the whole workspace. It worked and I don't know how it worked. But as long as it works, I'm happy.


However, as I continue to work on the project, this problem still occur sometimes and it keeps getting annoying. Taking awhile to investigate the cause, I found out that the error occurs because of the web.xml servlet-mapping. Have no idea why it cause the error occur but here is how I detected and fixed the problem:



  1. Deleted the servlet-mapping in the web.xml.

  2. Rerun the page that have the form (it can't do anything since it can't submit to servlet).

  3. Rewrite the servlet-mapping in the web.xml.

  4. Reload the url (not rerun again).


It worked every time and now I don't need to delete the whole workspace again. I still have no idea why it works. So if someone can share some proper explanations and have a better solution, please share; cuz I believe it is not a proper way to fix the problem and it is quiet annoying.


No comments:

Post a Comment