tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Williamson <Mark.William...@Appropria.com>
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
classpath
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).

mark 

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

Mime
View raw message