tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rene Dietze <rene.die...@sports-and-bytes.de>
Subject ClassCastException only in tomcat4
Date Tue, 22 Jan 2002 12:56:54 GMT

Hello..

I have a problem with tomcat 4.
My servlet application run's fine under jserv and tomcat 3.3
under tomcat4 receive a java.lang.ClassCastException

deep in my startup process.. load classes with the classLoader..

try
{
  System.out.println("loadClass:"+clazz);
  Object o = Thread.currentThread().getContextClassLoader().loadClass(clazz).newInstance();
  System.out.println("Instance:"+o.toString());
  de.SB.parser.hook.Section  s = (de.SB.parser.hook.Section)o;
}
catch(Exception e)
{
  System.out.println(e.toString());
}

Here my STDOUT:      
 loadClass:de.SB..parser.hook.Section
 Instance:de.SB.parser.hook.Section@62cb55
 java.lang.ClassCastException: de.SB.parser.hook.Section 


a simple TypeCast..

I use under all versions (jserv,tomcat3.3,tomcat4)
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

Linux Kernal 2.4.10


I attempted also that:
ClassLoader.getSystemClassLoader().loadClass(clazz).newInstance();
but the instance of Section is really ok


I hope yours can help me

rene


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message