Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP500 Error : Error instantiating servlet class controller.tutorController  RSS feed

 
tangara goh
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear experts,

I am getting this new error and then I googled and found out that with Java EE7 and web servlet annotation you won't need deployment descriptor.

However, if I remove my web.xml, specifically take out the servlet mapping, then a 404 resource not available error will appear.

What do I do to keep the container happy ?

Here's the error :

 
Rob Spoor
Sheriff
Posts: 20968
84
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that you have a class called tutorController in package controller? Because the error message indicates you don't, but that's what you've defined in web.xml.

About the 404, without a mapping in either web.xml or using the @WebServlet annotation, the container doesn't know what servlet should be used to handle the request, and that's why you get the 404.
 
tangara goh
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Are you sure that you have a class called tutorController in package controller? Because the error message indicates you don't, but that's what you've defined in web.xml.

About the 404, without a mapping in either web.xml or using the @WebServlet annotation, the container doesn't know what servlet should be used to handle the request, and that's why you get the 404.


I am most certain that I have.  I spent a few hours to make sure that the servlet mapping etc in the web.xml is correct too.

However, I have also read from the internet that from javaEE 7 onwards, if there is annotation, you won't even need the deoployment descriptor.

Anyway, I resolved the problem by re-starting the eclipse.

This problem, however, still appear on and off.

I wish there is a way to eradicate it for good.
 
Rob Spoor
Sheriff
Posts: 20968
84
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds more like a problem in Eclipse, Tomcat, or the link between the two. I've added this thread to both the IDEs and Tomcat forums.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!