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

