File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes HTTP-404 error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP-404 error" Watch "HTTP-404 error" New topic
Author

HTTP-404 error

Arajeshh Kumara
Greenhorn

Joined: Dec 29, 2007
Posts: 12
Hello ranchers,

I am getting the HTTP 404 erro when i am running my simple servlet....

my servlet name is ServletDemo.java. I compliled and got the .class file

where my .class file placed in C:\Tomcat\webapps\Example\WEB-INF\classes\simple\ServletDemo.class

my web.xml file is

i have placed this file in C:\Tomcat\webapps\Example\WEB-INF\web.xml

when i click on my application folder i got the http 404 error

when i typed in the location http://localhost:8080/Example/simple/ServletDemo
i got the same error


Please give me the suggestions

waiting for your valuable reply


[BPSouther: Added code tags]
[ February 08, 2008: Message edited by: Ben Souther ]
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
Because you have it mapped to /ServletDemo and not /simple/ServletDemo I think you need to change the url you are entering:

http://localhost:8080/Example/simple/ServletDemo
should be
http://localhost:8080/Example/ServletDemo

Also for your url-pattern, you may want to make it /ServletDemo/*


No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Arajeshh Kumara
Greenhorn

Joined: Dec 29, 2007
Posts: 12
I have changed the url-pattern as /ServleDemo/* and
when i entered the http://localhost:8080/Example/ServletDemo

I am getting the page as

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class simple.ServletDemo
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class simple.ServletDemo with modifiers ""
sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.25


Thanking you,
Rajesh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41635
    
  55
java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class simple.ServletDemo with modifiers ""

This error message is spot on: the class needs to be public. It's a bit oddly phrased, though - the double quotes enclose an empty string, since your class does not have any modifiers.


Ping & DNS - my free Android networking tools app
Arajeshh Kumara
Greenhorn

Joined: Dec 29, 2007
Posts: 12
Thank you very much sir

It's running

but one small doubt when typed in the address i m getting the result.....

i need to get when i click on my application...

If i clicked the application its showing http 404 error...


Thanking you,
Rajesh


 
wood burning stoves
 
subject: HTTP-404 error