Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3239504
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:58:40+00:00 2026-05-17T17:58:40+00:00

Using Hibernate in a struts2 webapp when the application redeploys I get this error

  • 0

Using Hibernate in a struts2 webapp when the application redeploys I get this error when trying to access pages after redeploy.

java.lang.IllegalStateException: Timer already cancelled.

Just after redeploy tomcat logs the following output which indicates the cause of the problem is that Hibernate is not shutting down properly when the first instance of the webapp is shutdown.

Oct 15, 2010 8:58:34 PM org.apache.catalina.loader.WebappClassLoader clearReferencesStopTimerThread
SEVERE: A web application appears to have started a TimerThread named [Timer-0] via the java.util.Timer API but has failed to stop it. To prevent a memory leak, the timer (and hence the associated thread) has been forcibly cancelled. 

I have added a ContextListener which with the following in the contextDestroyed method but this has had no effect.

@Override
public void contextDestroyed(ServletContextEvent arg0) {

    HibernateUtil.getSessionFactory().close();

}

Is there anything else I can do to prevent this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:58:41+00:00Added an answer on May 17, 2026 at 5:58 pm

    This warning is part of memory leak protection which got shipped with Tomcat 6.0.26. In this particular issue, you seem to be using commons-pool as connection pool. It is not properly terminating the timer thread. This has already been reported as a bug: issue POOL-161. It’s not fixed yet.

    It does actually not harm. Tomcat is doing its job right, just live with those warnings. If they are really bothering you, you can also consider to replace the connection pool by another one. I’d recommend tomcat-jdbc.

    See also:

    • Similar issue with commons DBCP
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a web application which uses framework like Struts and Hibernate. Currently I'm developing
I need your suggestions in designing a Java/J2EE web based application. Here are its
Using Hibernate how would you design and implement a search criteria page (which has
Using Hibernate 's Criteria API , I want to select the record within a
Using hibernate and Hsqldb - a list of objects are session.merged through a transaction.
im using hibernate and i maps my entities with annotations (so no xml files).
Is it possible put these three framework Spring, Struts 2.0 and Hibernate in single
I have been working for a while on a project with the following components:
---added (edit) -- should you do validation at the service layer, even if you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.