Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Servlets not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Servlets not working" Watch "Servlets not working" New topic
Author

Servlets not working

kumar shiva
Greenhorn

Joined: Jul 04, 2012
Posts: 12
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

Joined: Jan 10, 2002
Posts: 56543
    
  14

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?

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
kumar shiva
Greenhorn

Joined: Jul 04, 2012
Posts: 12
Thank you very much Mr.Bear Bibeault.
abhishek jethwani
Greenhorn

Joined: Aug 11, 2006
Posts: 14
try to run app again after adding closing tag for H1 (heading one)



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56543
    
  14

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

Joined: May 14, 2012
Posts: 5

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.


IT Training Manager with the Hartmann Software Group
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56543
    
  14

That's one of the checks in the ServletsFaq; there is no need to repeat it.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Servlets not working
 
Similar Threads
HTTP Status 404 error in tomcat
Geting error while i accessing URL
new to tomcat
404 Error
COUNT field incorrect or syntax error