404, as we all know is a FileNotFound error, is caused when the server is unable to locate the requested resource.
There will be posts that might sum up all the various reasons you get this when you hit your app deployed in tomcat, there will be posts that might be explaining it in detail, when you google one of the following :
“tomcat 404 not found”, “tomcat unable to locate a resource”, etc.
But I’m going to write in here only what I observed once when I was practicing some lessons from a book. Alright, you have created all the files all the files are in the proper place,the directory structure is intact as a normal web-app directory-structure should be,still when you start tomcat and hit the url in your browser,say:
and you get a 404, despite everything being in place, you start googling,but wait a minute, did you check your DD(Deployment Descriptor) ?
Open your DD in a browser and see if it renders the xml properly, as you have typed in it or not, If there’s a syntax error in the DD and the browser is opening it with error,bingo!!
If there’s an error in XMl syntax of your DD, tomcat doesn’t load your app on runtime, and that’s how you got a 404 this time.