cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: Reloading the mountableServlets map in DispatcherServlet
Date Wed, 14 Mar 2007 08:54:05 GMT
Daniel Fagerstrom wrote:
> Reinhard Poetz skrev:
>>
>> After more than two days of debugging, many thanks go to Torsten and 
>> Carsten who helped me to track down the problem, I found out, why the 
>> reloading classloader plugin doesn't propertly reload the Spring 
>> application context:
>>
>> The problem is that the DispatcherServlet contains a map of all 
>> mountable servlet services. This map is initialized in the init() 
>> method of the servlet and will never be reloaded. These servlets have 
>> a reference to the first Spring app context and every reset remains 
>> without effect.
> 
> Use OSGi ;)

hehe :-)

>> The simplest solution that I could think of is adding a check whether 
>> the system runs in dev mode. If true, the code, that collects 
>> information about all available servlet services, is executed every 
>> time when the service() method is called. As this doesn't seem to be 
>> expensive I think it's at least not the worst option.
>> All other solutions would either make the DispatcherServlet dependant 
>> from the ReloadingClassloader stuff or vice verca. But maybe it's only 
>> to late here and I overlook a simple solution.
> 
> There is a startup time stamp in the Spring application context 
> http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/context/ApplicationContext.html#getStartupDate()

> maybe you can use that.

thanks, I've introduced a check and committed the change. The RCL stuff now 
works for me :-)

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Mime
View raw message