This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Servlets not working

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
...........................................................................................................
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Mr.Bear Bibeault.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to run app again after adding closing tag for H1 (heading one)



 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's one of the checks in the ServletsFaq; there is no need to repeat it.
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic