Results 1 to 10 of 10

Thread: Installation: ThreadLocal forcefully removed

  1. #1
    Join Date
    Jan 2008
    Posts
    253

    Default Installation: ThreadLocal forcefully removed

    Hi,

    I'm trying to set up a Spring app on Tomcat 6/Spring 3/Ubuntu 8.04. After sucessfully running the website yesterday, today I see these errors when restarting Tomcat:

    PHP Code:
    INFOStopping service Catalina
    Feb 4
    2010 9:43:33 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
    SEVERE
    A web application created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Prototype beans currently in creation]) and a value of type [null] (value [null]) but failed to remove it when the web application was stoppedTo prevent a memory leakthe ThreadLocal has been forcibly removed.
    Feb 42010 9:43:33 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap

    SEVERE
    A web application created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Transactional resources]) and a value of type [null] (value [null]) but failed to remove it when the web application was stoppedTo prevent a memory leakthe ThreadLocal has been forcibly removed
    Not sure what it means or why it occurs.

    Any ideas?

    Marc

  2. #2
    Join Date
    May 2007
    Posts
    10

    Default

    I have upgraded tomcat to 6.0.24 and I get the same error everytime I stop tomcat. No changes made to the app since I was using 6.0.20.

    The Spring version I use is 2.5.6.SEC01. Can someone please advise why is this happening and whether it is serious enough as to not proceed with a deployment on tomcat 6.0.24?

    Thanks you,
    George
    George

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    The new Tomcat 6 adds a series of listeners to prevent against memory leaks and one of them, is against ThreadLocals. Unfortunately, there's no public API to deliberately remove ThreadLocals which rely on garbage collection. This is not something that affects only Spring but _all_ applications that create a ThreadLocal.

    I've raised this with some of the Tomcat committeers who are looking into this.

    Anyway, the messages are harmless and the runtime should not be affected by it.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  4. #4
    Join Date
    May 2007
    Posts
    10

    Default

    Thank you Costin!
    George

  5. #5
    Join Date
    Jun 2009
    Posts
    24

    Default

    Although this post is pretty old but I had similar issues and wanted to post solution.
    Check your version of jars against the tomcat. We had this problem when we switched from 6.0.14 to 6.0.26

    Here is the solution posted
    http://www.skill-guru.com/blog/2010/...cibly-removed/

  6. #6
    Join Date
    Dec 2011
    Posts
    7

    Default

    hi

    Anyway, the messages are harmless and the runtime should not be affected by it.
    Thank you
    tito

  7. #7
    Join Date
    Jul 2008
    Posts
    9

    Default Not Harmless

    Disclaimer: The last time I tried this was about 3 years ago.

    tito 1, I disagree with the assertion that this is harmless. With the configuration provided by georgea, Tomcat will start the application just fine. A hot-redeploy, however, will result in an error state that leaves the application stopped until Tomcat is restarted.

    While not a major issue in most cases, this bug can cause a problem. That said, it appears that a fix is available as vinay076 points out.

    In general, a SEVERE message should not be harmless. If it is, than it should be logged, at worst, as WARN. This, in and of itself, would be a bug. I recognize that this thread has more to do with Tomcat than with Spring, but it should be considered a compatibility issue.

  8. #8

    Default

    Hey vinay thanks for the link. It is very useful. Keep sharing buddy

  9. #9
    Join Date
    Dec 2011
    Posts
    7

    Default

    Quote Originally Posted by dgreenbean View Post
    Disclaimer: The last time I tried this was about 3 years ago.

    tito 1, I disagree with the assertion that this is harmless. With the configuration provided by georgea, Tomcat will start the application just fine. A hot-redeploy, however, will result in an error state that leaves the application stopped until Tomcat is restarted.

    While not a major issue in most cases, this bug can cause a problem. That said, it appears that a fix is available as vinay076 points out.

    In general, a SEVERE message should not be harmless. If it is, than it should be logged, at worst, as WARN. This, in and of itself, would be a bug. I recognize that this thread has more to do with Tomcat than with Spring, but it should be considered a compatibility issue.
    Thank you to make sure that when the search words are true indeed greetings.

  10. #10
    Join Date
    Dec 2011
    Posts
    7

    Default

    Quote Originally Posted by dgreenbean View Post
    Disclaimer: The last time I tried this was about 3 years ago.

    tito 1, I disagree with the assertion that this is harmless. With the configuration provided by georgea, Tomcat will start the application just fine. A hot-redeploy, however, will result in an error state that leaves the application stopped until Tomcat is restarted.

    While not a major issue in most cases, this bug can cause a problem. That said, it appears that a fix is available as vinay076 points out.

    In general, a SEVERE message should not be harmless. If it is, than it should be logged, at worst, as WARN. This, in and of itself, would be a bug. I recognize that this thread has more to do with Tomcat than with Spring, but it should be considered a compatibility issue.
    Thank you to make sure that when the search words are true indeed greetings.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •