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

-- 
_____________________
never trust a klingon


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to