Bug 44877

Summary: ClassCastException due to bad TagHandlerPool name generation of two different tags
Product: Tomcat 5 Reporter: illod <illod.wiki>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.5.26   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Small Eclipse 3.3 WST project

Description illod 2008-04-25 13:43:26 UTC
Created attachment 21857 [details]
Small Eclipse 3.3 WST project

The two different tags below will have the same TagHandlerPool name in the generated JSP. This will lead to a ClassCastException when accessing the JSP at runtime.

<bug:hello_world/>

<bug:hello world="true"/>

-------------------
Top of stacktrace :

java.lang.ClassCastException: fr.illod.tomcat.bug.taglib.HelloWorldTag
	org.apache.jsp.index_jsp._jspx_meth_bug_005fhello_005f0(index_jsp.java:115)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:75)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
        ...

--------------

The error seems to come from the "createTagHandlerPoolName" method in org.apache.jasper.compiler.Generator.java
Comment 1 Mark Thomas 2008-04-27 10:24:34 UTC
This has been fixed in trunk and proposed for 6.0.x and 5.5.x.
Comment 2 Mark Thomas 2008-05-01 13:45:20 UTC
The patch has been applied to 6.0.x and will be included in 6.0.17 onwards.
Comment 3 Mark Thomas 2008-05-16 10:57:50 UTC
Another opps - still open for 5.5.x
Comment 4 Mark Thomas 2008-07-30 13:16:40 UTC
This has been fixed for 5.5.x and will be included in 5.5.27 onwards.