From: Sebastian K. <seb...@mu...> - 2004-07-19 12:19:59
|
On Thursday 15 July 2004 08:17, Mark Crocker wrote: > I doubt this is simply a case of tomcat forgetting to close a resource for > the webmacro.jar file because there are several other jars in that lib > directory that get used and deleted just fine. hm, I'm suspecting one of the strange CacheManager we were using in 1.1final, but I'm not completely sure. I'll look into it when I've some time. Mark, do you use any special settings that could be related to the behaviour, or is everything from WebMacro.defaults? I just tested it with 2.0b1 and Tomcat 5 and undeploying works fine, except there is a thread remaining. It is the thread started by ClockDaemon from the concurrent package (used by the reloading cache manager). The problem is, that the Provider.destroy() method is never called by the Broker. A while back I added a reference counting scheme to the broker, that took care of destroying all providers and additional threads when the last WM client was destroyed. However, Brian removed this from 1.36 to 1.37, declaring it as a "hack" (okay, that's what it was), but did not create any replacement. I just hacked something together locally, where I manually destroy the providers and then everything works just fine, Tomcat can undeploy the webapp and no threads remain. I have two ideas, how to solve this: 1) Put the reference counting scheme back in place. The disadvantage is, that servlet writers have to call wm.close() on all WM instances they aquire. 2) Use a ServletContext listener. It could create a Broker on startup, register it in the servlet context under a well-known name and destroy the broker on shutdown. Disadvantages: Users have to set this listener up in their web.xml and it does not help for stand-alone mode. Suggestions? Sebastian PS: I've just integrated WebMacro into the Spring project (www.springframework.org) for a project, it fits in really nicely. If people are interested, I could commit this into CVS. -- Sebastian Kanthak PGP/GnuPG: http://www.muehlheim.de/~skanthak/pgp.html |