• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 67749
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: 67749
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: 67749
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.
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic