You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Filip Hanik <ma...@filip.net> on 2002/05/07 04:53:39 UTC

How do I get the classloader inside the session manager

Hi all,
it's me, I'm back.
I finally had time to pick up the code base again. Why not earlier, it's a
long story.
Anyway, there is a small detail (actually huge) that I completely missed
when I implemented the session replication, it is the different classloaders
for the different webapps. When serialized objects come accross the wire it
has to be deserialized using the right classloader.
If someone knows this on top of their head feel free to give me some tips,
otherwise I will start digging around.

Filip

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net

>-----Original Message-----
>From: Abraham Fathman [mailto:afathman@one.net]
>Sent: Monday, May 06, 2002 7:20 PM
>To: 'Tomcat Developers List'
>Subject: RE: Jasper2 background compilation and compile time include
>checks implemented
>
>
>Glenn,
>
>Thanks a lot for adding the '<%@ include file' support! I just signed up
>last night to be on this mailing list because I was going to start this.
>
>- Abe
>
>-----Original Message-----
>From: glenn@zathras.earthdome.org [mailto:glenn@zathras.earthdome.org]
>On Behalf Of Glenn Nielsen
>Sent: Monday, May 06, 2002 12:03 PM
>To: tomcat-dev@jakarta.apache.org
>Subject: Jasper2 background compilation and compile time include checks
>implemented
>
>
>I have committed the changes to Jasper 2 to implement background
>compilation and checking for outdated compile time included files.
>
>Here is a summary of the changes for those of you who do not get the CVS
>commit emails:
>
>Reduced amount of code within the JspServlet synchronized block, should
>improve performance slightly.
>
>Added ability to remove the JspServletWrapper and the class file for its
>JSP when a JSP file no longer exists.
>
>Added removal of JSP java source file to
>Compiler.removeGeneratedFiles().
>
>Moved the normalizing of the java class output directory
>from JspServletWrapper to JspEngineContext where it belongs.
>
>Moved obtaining the parentClassLoader, codeSource, classpath, and
>permissionCollection from the JspServlet to JspRuntimeContext.
>
>The servlet init method for the JSP was not getting called on the first
>load of the JSP page if the page were already compiled. This has been
>fixed.
>
>Refactored the code in JspServletWrapper for loadJSP to remove nested
>try/catch blocks and the overhead from several method calls.
>
>The outdated check for recompile now includes checking of compile time
>included files using <%@ include file="..." %>. The data about what
>pages were compile time includes is generated as part of the Servlet
>code for the JSP.  This is alot cleaner than my original proposal of
>storing the data in a separate file.
>
>Added the JspRuntimeContext background thread. It checks for changes to
>the JSP file and compile time included files.  If changed, it recompiles
>the JSP in the background. This will allow the previous compiled JSP
>class to be used until the page has been recompiled and the new class is
>available.  This will remove any request latency seen due to JSP
>recompiles. The background thread is only started if the web application
>context is a directory, reloading is enabled, and development is false.
>If the webapp is running directly from a war file there is no need to
>check for recompiles.
>
>Added two Jasper init parameters:
>
>    development - set to true to force an outdated check on
>                  each page request instead of using background
>                  thread.
>
>    checkInterval - Number of seconds background thread should
>                    wait before checking if JSP's are out dated.
>
>Passes all jsp watchdog tests except for the broken test case.
>
>Regards,
>
>Glenn
>
>----------------------------------------------------------------------
>Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
>MOREnet System Programming               |  * if iz ina coment.      |
>Missouri Research and Education Network  |  */                       |
>----------------------------------------------------------------------
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How do I get the classloader inside the session manager

Posted by Filip Hanik <ma...@filip.net>.
>If you are in an implementation of o.a.c.Manager, you can say:
>
>  ClassLoader webappCL = getContainer().getLoader().getClassLoader();
>
>> Filip
>>
>
>Craig
yeah, I just saw this, thanks a lot!!


Filip

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net

>-----Original Message-----
>From: Craig R. McClanahan [mailto:craigmcc@apache.org]
>Sent: Tuesday, May 07, 2002 8:27 AM
>To: Tomcat Developers List
>Subject: RE: How do I get the classloader inside the session manager
>
>
>
>
>On Tue, 7 May 2002, Filip Hanik wrote:
>
>> Date: Tue, 7 May 2002 07:28:38 -0700
>> From: Filip Hanik <ma...@filip.net>
>> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
>> To: Tomcat Developers List <to...@jakarta.apache.org>
>> Subject: RE: How do I get the classloader inside the session manager
>>
>> >The context classloader is supposed to be the webapp class loader.
>> >Is that what you want ?
>>
>> exactly, that is what I want. I assume there is a different
>classloader for
>> each web app.
>> how do I get this guy from the session manager?
>
>If you are in an implementation of o.a.c.Manager, you can say:
>
>  ClassLoader webappCL = getContainer().getLoader().getClassLoader();
>
>> Filip
>>
>
>Craig
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How do I get the classloader inside the session manager

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 7 May 2002, Filip Hanik wrote:

> Date: Tue, 7 May 2002 07:28:38 -0700
> From: Filip Hanik <ma...@filip.net>
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tomcat Developers List <to...@jakarta.apache.org>
> Subject: RE: How do I get the classloader inside the session manager
>
> >The context classloader is supposed to be the webapp class loader.
> >Is that what you want ?
>
> exactly, that is what I want. I assume there is a different classloader for
> each web app.
> how do I get this guy from the session manager?

If you are in an implementation of o.a.c.Manager, you can say:

  ClassLoader webappCL = getContainer().getLoader().getClassLoader();

> Filip
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How do I get the classloader inside the session manager

Posted by Filip Hanik <ma...@filip.net>.
>The context classloader is supposed to be the webapp class loader.
>Is that what you want ?

exactly, that is what I want. I assume there is a different classloader for
each web app.
how do I get this guy from the session manager?
Filip

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net

>-----Original Message-----
>From: Remy Maucherat [mailto:remm@apache.org]
>Sent: Monday, May 06, 2002 8:17 PM
>To: Tomcat Developers List
>Subject: Re: How do I get the classloader inside the session manager
>
>
>> Hi all,
>> it's me, I'm back.
>> I finally had time to pick up the code base again. Why not
>earlier, it's a
>> long story.
>> Anyway, there is a small detail (actually huge) that I completely missed
>> when I implemented the session replication, it is the different
>classloaders
>> for the different webapps. When serialized objects come accross the wire
>it
>> has to be deserialized using the right classloader.
>> If someone knows this on top of their head feel free to give me
>some tips,
>> otherwise I will start digging around.
>
>The context classloader is supposed to be the webapp class loader.
>Is that what you want ?
>
>Remy
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How do I get the classloader inside the session manager

Posted by Remy Maucherat <re...@apache.org>.
> Hi all,
> it's me, I'm back.
> I finally had time to pick up the code base again. Why not earlier, it's a
> long story.
> Anyway, there is a small detail (actually huge) that I completely missed
> when I implemented the session replication, it is the different
classloaders
> for the different webapps. When serialized objects come accross the wire
it
> has to be deserialized using the right classloader.
> If someone knows this on top of their head feel free to give me some tips,
> otherwise I will start digging around.

The context classloader is supposed to be the webapp class loader.
Is that what you want ?

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>