What is 'log', is it an injected logger service? Once shutdown has started, other services may already have been deactivated, so those calls may fail.
On 3 April 2013 16:27, Muhammad Gelbana <m.gelb...@gmail.com> wrote: > I use tapestry to develop windows services so this should be similar to a > desktop application I suppose and it's no where close to a web application. > > This method is supposed to register a registryWillShutdownListener > > @Startup > public void startup(RegistryShutdownHub registryShutdown, @IpK final > IMonitoredConfigurationSource ipkConfig, final Logger log) { > log.info(registryShutdown); // This is called > registryShutdown.addRegistryWillShutdownListener(new Runnable() { > @Override > public void run() { > log.warn("Announcing shutdown"); // This whole method as if it > doesn't exist ! > ipkConfig.shutdown(); > log.warn("IpkConfig: " + ipkConfig.isShuttingDown()); > } > }); > } > > What is really strange is that *there are other modules being contributed > just like this one and their shutdown listeners act as expected*, except > for this module ! In addition to the first logging call being actually > invoked and I can see it's output in the log files, I can also see the > module contribution message by tapestry so this module is definitely being > loaded, I just don't know why isn't this listener being invoked. > > Are their any other precaution I should consider for my shutdown listeners > to surely work ? > > Thank you. >