aspose file tools*
The moose likes Servlets and the fly likes Class LoginServlet not a Servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Class LoginServlet not a Servlet?" Watch "Class LoginServlet not a Servlet?" New topic
Author

Class LoginServlet not a Servlet?

Alan Shiers
Ranch Hand

Joined: Sep 24, 2003
Posts: 236
Hi there,

I created a servlet called LoginServlet which extends HttpServlet. It has
the usual doGet() and doPost() methods. It compiles fine but when I try to
access it, Tomcat throws a ServletException saying my "Class LoginServlet is
not a Servlet". How absurd is that?

Any ideas as to what's going on? StackTrace and Class code is below. I
compiled using JVM 1.5. Using Tomcat 5.5.4.

Thanks,

Alan

INFO: Server startup in 13597 ms
12-Jan-2005 5:00:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet LoginServlet as unavailable
12-Jan-2005 5:00:16 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet LoginServlet
javax.servlet.ServletException: Class LoginServlet is not a Servlet
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
15)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:711)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:131)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:383)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)

*****************************************************************
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
what about your web.xml ??
Alan Shiers
Ranch Hand

Joined: Sep 24, 2003
Posts: 236
Here it is. Not a lot to it:

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
It looks fine to me. May be someone else would find the culprit.
Jim Chrystal
Greenhorn

Joined: Jan 19, 2005
Posts: 6
Prefix your servlet class with the full package name, i.e., com.somepackage.MarksServlet

- Jim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class LoginServlet not a Servlet?
 
Similar Threads
Problem with DbConnectionBroker
Passing parameters
SQL syntax error
Passing parameter to servlet from another servlet
How do I make stuff show on a web page?