• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlets not working  RSS feed

 
kumar shiva
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please can anyone help me?

I created application folder app1 inthat WEB-INF -->Classes and web.xml
In Classes Servlet1.java as below


web.xml script like below


Compiled sucessfully but when i entered address(http://localhost:8081/app1/s1) in address bar it is giving below message


type Exception report

message Error instantiating servlet class pack1.Servlet1

description The server encountered an internal error (Error instantiating servlet class pack1.Servlet1) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class pack1.Servlet1..
...........................................................................................................
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shiva don wrote:I created application folder app1 inthat WEB-INF -->Classes and web.xml

classes, not Classes. Case counts.

And is the pack1 folder created for the package? (Please use better names than pack1.)

Have you followed the steps in the ServletsFaq to diagnose this problem?
 
kumar shiva
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Mr.Bear Bibeault.
 
abhishek jethwani
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to run app again after adding closing tag for H1 (heading one)



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abhishek jethwani wrote:try to run app again after adding closing tag for H1 (heading one)

Errors in HTML will have no effect on whether the servlet will execute or not.
 
Andreas Taber
Greenhorn
Posts: 5
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the classes associated with this servlet in the servlet engines classpath? If they're not, that engine is going to have difficulty instantiating the servlet.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's one of the checks in the ServletsFaq; there is no need to repeat it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!