Mock tests, Interview questions, Tutorials and Tech news
 
 
Home > Programming / tutorials > Tomcat 6.0.26 shutdown reports “A web application created a ThreadLocal …. ThreadLocal has been forcibly removed”

Tomcat 6.0.26 shutdown reports “A web application created a ThreadLocal …. ThreadLocal has been forcibly removed”

This problem happened with an JSF , Hibernate and rich faces application which was running on tomcat 6.0.14 version and Jdk1.6.0 . When upgraded to Tomcat 6.0.26 and JDK 1.6.0-19, it started behaving strangely.

The jsf messages were displayed as html  and looked as the servver was not parsing them.

for eg {userbean.errorMessage} started showing on pages.

After much analysis it was found that this problem is because of tomcat upgrade.  Why is this problem ?

From the documentation

For the #{} expressions to be recognized in Tomcat 6, your web application must adhere to the Servlet 2.5 specification. Make sure, that version and xsi:schemaLocation attributes of element in your WEB-INF/web.xml file have the correct values. You can look into conf/web.xml or into the examples application for an example.
In the versions 6.0.24 and earlier the deferred expressions were processed regardless of the specification version specified in web.xml. That was changed/fixed in 6.0.26.

Below is solution

Changed

<?xml version=’1.0′ encoding=’UTF-8′?>
<!DOCTYPE web-app PUBLIC
“-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”
“http://java.sun.com/dtd/web-app_2_3.dtd”>
<web-app>

……………..

to

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns=”http://java.sun.com/xml/ns/javaee”
xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
id=”WebApp_ID”
version=”2.5″>

…………………

remove these if they exist in your web.xml

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/jsf_core.tld</taglib-uri>
<taglib-location>/WEB-INF/jsf_core.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/html_basic.tld</taglib-uri>
<taglib-location>/WEB-INF/html_basic.tld</taglib-location>
</taglib>

If this was helpful , please add comment below

Be Sociable, Share!
Categories: Programming / tutorials Tags: ,
  1. Diadem
    July 11th, 2013 at 03:49 | #1

    Thank you for this! It worked well. The error is gone.

  2. Mohan
    July 23rd, 2012 at 14:31 | #2

    Wow, it worked for me for a problem which wrecked my weekend. Thanks.

  3. Madhuri
    February 9th, 2012 at 07:57 | #3

    Thanks a lot for this solution. I have spent almost more than a week to resolve this issue. And since it does not generate any error even searching on Google was not helping me solve this problem. Finally, your solution helped. Thanks a lot !!!

  1. October 15th, 2010 at 12:44 | #1

Get Adobe Flash playerPlugin by wpburn.com wordpress themes