Go Premium for a chance to win a PS4. Enter to Win


Springframework shutdown in tomcat don't work

Posted on 2006-06-16
Medium Priority
Last Modified: 2013-11-24
Hi everyone,

I'm using the <bean ... init-method="connect" destroy-method="disconnect"> feature in applicationcontext.xml.
While the init-method gets called the destroy method gets not touched if TOMCAT shuts down.
The framework works fine! Just this feature don't work.
Are there any other settings (except the web.xml       <listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>  entry ) needed, to force the springframework to receive the shutdown event from tomcat?

Thanks for the help!


Question by:hefter1
  • 5
LVL 92

Accepted Solution

objects earned 2000 total points
ID: 16919685
That gets called when the context gets shutdown, is the context getting shut down when tomcat does?

Author Comment

ID: 16919825
Hi objects,

I just get a
***This server has been successfully shutdown***
message, nothing else. I'm using Eclipse with MyEclipse plugin to control tomcat.
Maybe I should add a log.xml entry for the spring container?


Author Comment

ID: 16919916
I can't see that the context shuts down in debug mode.
How else could I see that?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 16919935
I tried to implement  DisposableBean - no effect! Even this method gets not called!! So the container has no control!?
The beans I'm using are singletons by default.

Author Comment

ID: 16920050
Found the reason: If I call it as a service everything works fine. It seems that the MyEclipse plugin don't call the shutdown. Grrrrr.

Author Comment

ID: 16932686
In the meantime I got response from MyEclipse. They will fix that in upcoming Version 5 in july 2006.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question