• Community
  • Products
  • Jira Core
  • Questions
  • SEVERE: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@53dafbaf]) and a value of type [org.dom4j.DocumentFactory] (value [org.dom4j.DocumentFactory@4dc1c92b]) but failed to remove it whe

SEVERE: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@53dafbaf]) and a value of type [org.dom4j.DocumentFactory] (value [org.dom4j.DocumentFactory@4dc1c92b]) but failed to remove it whe

 

2 answers

Could you elaborate a little more on what the problem is?

1 vote
Chris Fuller Atlassian Team Jul 24, 2016

Short answer: This error message is coming from Tomcat and you probably don't need to worry about it unless you see it while developing a P2 plugin or find that JIRA won't actually shut down when asked and you're having to kill the process.

Long answer:

Like other servlet containers, Tomcat has mechanisms for managing what applications are deployed to it with the intention that you might change this on the fly.  For example, you could have a single tomcat instance with both JIRA and Confluence served by it, then add Crowd to that already running servlet container.

In practice, it is very hard to make that idea work, and the lack of operating system level isolation between the applications in the container means that an outage for one could easily take out the others, so Atlassian applications normally deploy as all-in-one standalone distributions with a Tomcat instance all to themselves, and we don't recommend changing that.

As a result, we don't actually deploy JIRA or any other application in a manner where it would matter if a thread local isn't removed by JIRA shutting down, because if you are shutting down JIRA then you are shutting down Tomcat, too, so the "leak" is not going to matter.  However, the warning could be a symptom of two other related problems that you might see:

  1. During a P2 plugin's upgrade or a full system import, a plugin can be asked to shut itself down, and any threads it has spawned should be cleaned up as part of this.  If that plugin fails to shut down all of its spawned threads, that can lead to memory leaks and unstable behaviour when the plugin is upgraded on a live system.
  2. A plugin that has failed to clean up its threads might also prevent the shutdown from completing at all if the threads still look "active" and were not created as "daemon" threads.

So if you are a developer of a P2 plugin and your own plugin seems to be involved, you should investigate.  Try doing 5 imports in a row and check what threads are running.  Always name the threads you spawn to make it easier to identify their source if they cause any trouble.

If none of that applies to you and you aren't experiencing any trouble shutting JIRA down gracefully, you should most likely ignore the message.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

149 views 1 17
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you