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:58:53 GMT
Not sure - the JSP is called via the RequestDispatcher 
but in several FAQ's I have seen the JSP gets its own
class loader when its loaded. The classes currently 
reside in WEB-INF and so they are loaded by the 
servlet engine or the jsp engine at run time - we 
are only at prototype stage so the code is all over 
the place. 

-----Original Message-----
From: kc.baltz []
Sent: 01 June 2000 14:37
To: ''
Subject: RE: A bit of an odd one

I'm just curious, are you using a different class loader or JVM on purpose?
I have never had the trouble you describe with request.getAttribute() and
I'm curious what you are doing different.


> -----Original Message-----
> From: Mark Williamson []
> Sent: Thursday, June 01, 2000 9:48 AM
> To: ''
> Subject: RE: A bit of an odd one
> 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...)
> --------------------------------------------------------------
> ------------
> To unsubscribe, email:
> For additional commmands, email:

To unsubscribe, email:
For additional commmands, email:

View raw message