tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: How to avoid reboot of tomcat
Date Fri, 29 Sep 2000 10:40:17 GMT


> -----Original Message-----
> From:	Christoph Schaper [SMTP:christoph@schaper.org]
> Sent:	Friday, September 29, 2000 2:20 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	Re: How to avoid reboot of tomcat
> 
> DANNY.SO@gurubase.com wrote:
> > 
> > Hi all experienced tomcat user & developer
> > 
> > It is highly appreciated that if someone can offer answers to my below
> > questions.
> > 
> > 1) l found that everytime, l changed the beans & classes used in my JSP,
> l need
> > to reboot the tomcat to make the JVM reload the most up-to-date beans &
> classes.
> > Is there any way to avoid rebooting the tomcat after l changed the beans
> and
> > classes ?
> > 
> > 2) Is there any way to detect whether or not there is any user using the
> > tomcat ? (check whether there is any session object stored in tomcat) ?
> > 
> > thanks a lot in advance.
> > 
> > regards
> > Danny
> i had the same problem with included jsp files
> and a simple trick solved this problem you need to tell the
> client jsp about the update :
> <%-- /jsp/MyTest.jsp modified 4/3/00 --%>
> <%@ include file="/jsp/MyTest.jsp" %>
> hope this helps
> Christoph
> 
	[Kitching Simon]  
	I think we're talking about a different issue here.
	1) 
	If you change a .jsp file, then tomcat detects this & 
	recompiles it immediately
	2) 
	If you change a file that is <%@ include> 
	from a .jsp file, then tomcat doesn't
	and is unlikely to ever detect this. In order to 
	detect this, tomcat would need
	meta-information somewhere about the 
	dependencies between a .jsp file and
	all the files it includes, and it would need to 
	walk this tree of dependencies each
	time a .jsp file is accessed to determine 
	if the .jsp needs to be recompiled.
	A workaround is to update the timestamp 
	on all .jsp files which <%@include> a 
	changed file, either manually, or by using a tool like ant, make,
etc.
	3) 
	If you change a class or bean, then asking 
	tomcat to handle this really is 
	asking a lot! Just try to change a dll while 
	microsoft word is running & see if
	it detects the change! Actually, some 
	limited functionality is available, because
	of the way that tomcat uses "class loaders". 
	I don't know very much about class-loaders,
	so what is possible will have to be answered 
	by someone else. I can see a number of
	potential problems, though. I am amazed 
	that tomcat claims to be able to "reload servlets"!
	(a)
	linking of classes is done at class load time; 
	removing a class & loading a
	new one would involve relinking all 
	classes in memory to the new class, no?
	(b) 
	there could be object instances around. 
	You can't just point these to a new class,
	because the new class may have more 
	or less attributes, etc.

	JSP page reloading is a slightly different 
	issue from servlet reloading, because the
	class name for the jsp page is *generated*. 
	Therefore tomcat can generate a new
	version of a jsp page into a new servlet with 
	a different name, then change its mapping
	tables so the old url points to the new class. 
	No class needs to be unloaded from memory.
	The implication is that the old class stays in 
	memory.....still, how often does a jsp file change??

	Any comments above apply to my 
	setup - tomcat3.1 on HPUX, jdk1.2.2_04

	Regards,

	Simon
> -- 
> ---------------------------------------
>   Christoph Schaper
>   email :christoph@schaper.org
>   homepage http://schaper.org/christoph
>            http://schaper-edv.de
> ---------------------------------------

Mime
View raw message