struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McGrady <>
Subject Re: Way to reload struts Action classes in WebLogic8.1
Date Sun, 02 May 2004 22:50:52 GMT
This is more of a passing interest of mine, so I will pursue a bit more, if 
you continue an interest.  I have an application that needs to do this from 
afar on multiple and untrackable sites.  So, the bouncing the server idea 
just won't work for me.  I need this to happen without exchanging 
classloaders, and probably without fiddling with the classloader API.  So, 
this is my thought: that you have multiple dependencies is not important so 
long as they all obey the "pattern" we were discussing, i.e., 1., 2., and 
3.  So, any application framework that provided reloading only to the 
requisite classes, those that followed this "pattern" would not be 
"half-assed" at all but would be fully workable.  One might even use a tag 
interface, e.g. Reloadable, to identify which classes had this sort of 
independence.  If all classes were created and were loaded on this sort of 
structure, there would never be a need to bounce servers, etc.  That, I 
think, is a very workable solution, and another reason why using interfaces 
is so important in designing architectures.  Whew!  That may be false but 
it sure is ambitious.  ///;-)


At 01:25 PM 5/2/2004, Craig R. McClanahan wrote:
>Michael McGrady wrote:
>>To expand (part question and part statement):  Suppose:
>>1.  We made an interface, Action, which the present Struts Action 
>>(renamed, say, "ActionImpl") implemented.
>>2.  We created a daemon ActionFactory which loaded actions from outside 
>>the CLASSPATH using a URLClassloader, etc., and which did not reference 
>>the implementation(s) but only the interface.
>>3.  We created a method in the main(String [] params) for the web 
>>container which allowed us to reload using the ActionFactory.
>Steps 1 and 2 are pretty much how many servlet container deals with 
>individual JSP pages that have been changed ... they are each loaded into 
>a separate class loader (an alternative strategy is to change the 
>classname for each generated servlet, and add that class to the existing 
>webapp class loader).
>This works fine for classes that never refer to each other.  But what do 
>you do with classes (like DTOs or form beans) that might be referenced by 
>more than one Action?  You're back to where we started.  Unless/until Java 
>provides ClassLoader.unloadClass(), this is not a problem that can be 
>solved inside a webapp.
>I am not a believer in providing half-assed solutions to this kind of 
>problem, or an application framework pretending to be an app server 
>container.  Instead, you're better off finding app server implementations 
>that do the reload trick fast enough to meet your needs.  My typical 
>reload turnaround time during development, on either Tomcat or Sun's  app 
>server (the 8.0 version of PE) is under two seconds, even counting the 
>fact that I typically invoke it with a command line Ant invocation.  I 
>don't consider that to be a problem.
>>Wouldn't that work with very little effort?
>As described above, it only solves part of the problem ... not enough to 
>make it worth implementing, IMHO.
>>Michael McGrady
>To unsubscribe, e-mail:
>For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message