aspose file tools*
The moose likes Servlets and the fly likes Can't access my Servlet... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Can Watch "Can New topic
Author

Can't access my Servlet...

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I'm calling my servlet in my jsp file via form submit. However, when I do this... I get this error message...


type Exception report

message

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

exception

javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)


root cause

java.lang.NoClassDefFoundError: weeklytask/DBHandler (wrong name: DBHandler)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1650)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:856)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1305)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)


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



Here is my JSP file...


and my Servlet file...



Now my servlet really does nothing but to print to the console that it was accessed... I'm starting to wonder if I have invoked the url right... Thanks! Oh... Here's my web.xml file...

Web.xml file...


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
clive jordan
Ranch Hand

Joined: Apr 27, 2005
Posts: 39
Hi Timothy,

This looks like a classpath problem.

You could try adding:

package weektask

to your servlet.

Otherwise, try removing weeklytask from your config.

i.e. change:


to:


Cheers,
Clive
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I found the error... It seems like I forgot to inlude the package...




Thanks for your reply!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't access my Servlet...