You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kris Rasmussen <kr...@yahoo.com> on 2004/11/25 11:48:18 UTC

classloading across contexts

Ok, I know this isn't quite a tapestry specific question, but I was hoping someone could help anyways. I am considering using a single tapestry webapp to drive multiple domains with similar content. However, I don't quite understand how tapestry and say tomcat for example, handle class loading/page pooling/template loading/ etc. If I create a single tapestry web application, but reference it from multiple contexts, what exactly is being shared if anything? Is the servlet container just going to duplicate all code that is located in the webapp directory (I know it will reuse code in shared libraries)? When the pages are compiled will the compiled templates be shared, or will each domain(context) store a duplicate copy of the template in memory?
 
Thanks,
 
Kris
		
---------------------------------
Do you Yahoo!?
 Meet the all-new My Yahoo! � Try it today! 

Re: classloading across contexts

Posted by Kris Rasmussen <kr...@yahoo.com>.
Thanks Marcus. I guess I already knew how classloading worked but I was more curious if anyone in the tapestry list has ever thought about doing this and run into the same problems. I also entertained the thought of someone here knowing of another java server that could be configured to share a webapp or give another solution.
 
I actually ran some tests before posting my first message and noticed that while the memory usage basically increases linearly with the number of contexts referencing the same web app, it does not appear to increase linearly when those contexts are accessed. Usually when I access a webapp using tapestry for the first time, it seems to take a while to load, possibly because of templates loading or something. However, when I access the same webapp from different contexts it only takes a while to load for the first context. Anyone know why I might be noticing this?
 
Thanks again,
Kris

Marcus Brito <mb...@gmail.com> wrote:
I guess this is a question to tomcat-users, or maybe tomcat-dev.
Tapestry itself doesn't manage classloaders.

Generally, however, web servers use a different classloader for each
web application. If you have the same library deployed to WEB-INF/lib
in two different applications, it will be loaded twice. If you want to
share a library between two or more applications, you should deploy
this library to a common repository -- if you're using tomcat, that's
$CATALINA_HOME/common/lib. Be warned, however, that not all libraries
work correctly when shared by multiple applications, since all
applications would share the same static data.

-- Marcus Brito

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - You care about security. So do we.

Re: classloading across contexts

Posted by Marcus Brito <mb...@gmail.com>.
I guess this is a question to tomcat-users, or maybe tomcat-dev.
Tapestry itself doesn't manage classloaders.

Generally, however, web servers use a different classloader for each
web application. If you have the same library deployed to WEB-INF/lib
in two different applications, it will be loaded twice. If you want to
share a library between two or more applications, you should deploy
this library to a common repository -- if you're using tomcat, that's
$CATALINA_HOME/common/lib. Be warned, however, that not all libraries
work correctly when shared by multiple applications, since all
applications would share the same static data.

-- Marcus Brito

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: classloading across contexts

Posted by Kris Rasmussen <kr...@yahoo.com>.
Does anyone know anything about app server memory managment who might be able to answer my question below? I really want to use tapestry for my next project, but I want to make sure the memory requirements won't be too extreme.
 
Thank you again,
 
Kris

Kris Rasmussen <kr...@yahoo.com> wrote:
Ok, I know this isn't quite a tapestry specific question, but I was hoping someone could help anyways. I am considering using a single tapestry webapp to drive multiple domains with similar content. However, I don't quite understand how tapestry and say tomcat for example, handle class loading/page pooling/template loading/ etc. If I create a single tapestry web application, but reference it from multiple contexts, what exactly is being shared if anything? Is the servlet container just going to duplicate all code that is located in the webapp directory (I know it will reuse code in shared libraries)? When the pages are compiled will the compiled templates be shared, or will each domain(context) store a duplicate copy of the template in memory?

Thanks,

Kris

---------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! � Try it today! 
		
---------------------------------
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.