cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Reloading the mountableServlets map in DispatcherServlet
Date Tue, 13 Mar 2007 23:24:04 GMT

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.

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.

-- 
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