Solved

Springframework shutdown in tomcat don't work

Posted on 2006-06-16
6
645 Views
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!

Frank

0
Comment
Question by:hefter1
  • 5
6 Comments
 
LVL 92

Accepted Solution

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

Author Comment

by:hefter1
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?

Frank
0
 

Author Comment

by:hefter1
ID: 16919916
I can't see that the context shuts down in debug mode.
How else could I see that?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:hefter1
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.
0
 

Author Comment

by:hefter1
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.
0
 

Author Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now