tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randall Parker" <>
Subject ClassCastException on Tomcat initialization
Date Tue, 22 Feb 2000 23:09:17 GMT
I am running Tomcat v3 on VAJ EE v3. Initially I was able to get Tomcat up and running. But
I had ClassCastExceptions in ServletWrapper.loadServlet() when I tried to load one of my own
servlets. This 
made no sense since the cast that it was failing on was for
   servlet = (Servlet)servletClass.newInstance();
 but the class it was loading was declared as:
public class UserLoginMgr extends javax.servlet.http.HttpServlet

So the cast back to Servlet ought to be possible. 

So I tried adding more projects to the classpath for StartTomcat. Then I started getting ClassCastExceptions
when Tomcat was first initializing. The first class that it tried to load in 
ServletWrapper.loadServlet() generated a ClassCastException. This was org.apache.tomcat.core.DefaultServlet.

So then I tried to eliminate from StartTomcat's path all the projects that I'd previously
added. After doing so I still keep getting ClassCastException in org.apache.tomcat.core.DefaultServlet
on Tomcat 
initialization. So I can't run Tomcat at all. 

Oh, and it is loading the servletClass without an exception by using the previous executable
line of:
   servletClass = container.getLoader().loadServlet(this,servletClassName);

Anyone have any clues as to why this is happening? Would it help to move up to a later Tomcat

View raw message