Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

404 error while compiling the servlet

 
mani sagar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi '
i am getting this error while compiling the servlet. here is the copy of log file from the tomcat .

the next error i got was this
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has absolutely nothing to do with compiling or even with a servlet. It indicates that your web.xml has syntax errors.
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First one actually the log which indicates the startup of your server, not an error. In the second one which actually gives a SAXParseException. Your web.xml's "<web-app>" tag must be wrong, check whether you have properly closed it at the end.
 
mani sagar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for replying .

i did follow the other threads on 404 error and did clear my web. xml file from errors but still i got the same error. i even tried to changing the <web-app> heading but still i get this error.

i am able to read all the tomcats own pages( eg : from those inside the /webapps/Root/ directory but i am not able to run my project.(the beer example from k&b book)

i was able to run the ch1Servlet example though.
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mani,

Now what's the issue you are having? Can you provide more details? What are you trying to do, what components are involved, your mappings in web.xml etc.. ?
 
mani sagar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi vijitha ,

i am using tomcat 6.0 pre configured,jdk 1.5.

i am not at my home computer because of which i wont be able to give you the exact form of my web.xml.

i am following the head first's book and all the settings are as per that.i have modified the web-app portion of my web.xml to match the tomcats specification.

i have a question though: does the tomcat container refer to the web.xml file for even the home page or index page(and in this case form.html)? because i am not able to get even the form.html page up!

 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mani sagar wrote:does the tomcat container refer to the web.xml file for even the home page or index page(and in this case form.html)? because i am not able to get even the form.html page up!

Yes, container parses the web.xml at the application server startup or at the context restart of that application before any request being made.
 
mani sagar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all... sorry for such a long delay...

here is my web.xml page.

also when i shifted the contents of my project folder i.e Beer into the Root folder of tomcat/webapps/root the application worked (though i directly asked for resourse i.e http://localhost:8080/form.html,and after pressing the submit button i got an error ....

so my confusion is, if my web.xml file is incorrect then it should not execute the request even if it is stored in any part of webapps folder... but surprisingly it is executing!

secondly by observing the context.xml in the conf folder of apache

here i presume that the part <Watchedresourse >stands for the folder in which all resourse are placed but as mentioned it works for only one folder i.e root not for any other folder. is there any problem with the preconfigured tomcat that they would read the resourse only from within root folder... i.e root folder acts as the web apps folder???
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mani sagar wrote:
here is my web.xml page.


As it shows, your web.xml is missing the last part, I suggest you copy the whole <web-app...> thing from the ROOT/WEB-INF/web.xml to your's and deploy to see what happens. You should deploy it as a separate application from the ROOT not inside of it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic