tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Williamson <>
Subject RE: A bit of an odd one
Date Thu, 01 Jun 2000 13:48:00 GMT
Ok and now I HAVE sussed it :-

after some investigation here is what I think is going on:

	1) the Servlet and JSP's have different classloaders - a JSP 
	    typically gets a new Class loader everytime its instantiated.
            2) the is made  via one classloader and passed
                it to another - this causes a ClassCastException.
The solution to this is to force the basic JVM to load the classes you want 
to pass around - ie. your application classes should be in the system
not the servlet or jsp path. This way the base classloader will get them 
for you. The other possible solution is to serialize the class into 
a string and reconstitute over the other end (ie. how RMI and stuff 
does it).


(very sorry about talking to myself on the list - but I think that it is
likely to 
be a common problem...)

View raw message