Bean's destroy method not invoked when kernel is shut down [message #749397] |
Tue, 25 October 2011 07:40 |
Barbara Rosi-Schwartz Messages: 448 Registered: July 2009 |
Senior Member |
|
|
Hello everyone.
I am creating a Spring bean declaratively with a "destroy-method" attribute defined in it. When I shut the Virgo kernel down (using the standard script), however, this method is not invoked. Why is that? What do I have to do?
I have also tried to register an ApplicationListener for ApplicationContextEvents, listening for ContextStoppedEvents specifically, but the call back method is never invoked either when the server is shut down.
TIA,
B.
[Updated on: Tue, 25 October 2011 08:28] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Bean's destroy method not invoked when kernel is shut down [message #753465 is a reply to message #753424] |
Thu, 27 October 2011 11:38 |
Barbara Rosi-Schwartz Messages: 448 Registered: July 2009 |
Senior Member |
|
|
Fantastic, Glyn, thanks!
Seems like a rather last ditch way to do it, but if all else fails...
Doesn't it seem like a bug to you though? Surely if the container is shut down, the declared destroy method of all instantiated beans should be invoked. Do you agree?
The other (probably silly) issue I face is that, despite my attempts to delete the plan file from the pickup directory (in other cases too, not just when I shut down), the delete operation fails presumably because the file is locked by the running Virgo related process. Any work around that one?
Thanks again,
B.
[Updated on: Thu, 27 October 2011 11:41] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02196 seconds