Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

HTTP500 Error : Error instantiating servlet class controller.tutorController

 
Ranch Hand
Posts: 534
  • 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 :

 
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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: 534
  • 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: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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!