You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/07/05 14:13:37 UTC

DO NOT REPLY [Bug 39966] New: - Class Cast Exception inTagHandlerPool

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39966

           Summary: Class Cast Exception inTagHandlerPool
           Product: Tomcat 5
           Version: 5.5.17
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: nikolaymetchev@gmail.com


I have written a Custom tag which extends SimpleTagSupport. I am getting a very
spurious error occuring very rarely.

If I have a JSP page which is very simple and just uses the custom tag itself
then everything works as expected. However in a more complicated application I
get the exception below. I am curious under what circumstances does the
TagHandlerPool get used instead of just instantiating the tag class directly?
Should it be checking to see if it is a SimpleTag and converting it using a
TagAdapter on line 116?


java.lang.ClassCastException: com.teamphone.common.jsp.image.ImageTag
	at org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:116)
	at
org.apache.jsp.WEB_002dINF.views.default_.authentication.LogonRenderer_jspx._jspx_meth_image_image_0(LogonRenderer_jspx.java:373)
	at
org.apache.jsp.WEB_002dINF.views.default_.authentication.LogonRenderer_jspx._jspService(LogonRenderer_jspx.java:140)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
	at
com.teamphone.common.servlet.http.HttpDocumentFactory$ForwardDocument.writeBody(HttpDocumentFactory.java:329)
	at
com.teamphone.common.servlet.http.HttpDocumentFactory$AbstractDocument.write(HttpDocumentFactory.java:200)
	at com.teamphone.common.servlet.http.HttpServlet.doRequest(HttpServlet.java:173)
	at com.teamphone.common.servlet.http.HttpServlet.doGet(HttpServlet.java:100)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:595)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 39966] - Class Cast Exception inTagHandlerPool

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39966


yoavs@computer.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




------- Additional Comments From yoavs@computer.org  2007-03-25 15:10 -------
Without a test JSP or test WAR to reproduce this problem, it's all theoretical.
 However, looking at the code path assuming a JSP 2.0 valid TLD and
configuration, it looks fine to me.  If you can provide a test WAR we can use to
reproduce this problem, I'd be glad to try it out.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 39966] - Class Cast Exception inTagHandlerPool

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39966





------- Additional Comments From nikolaymetchev@gmail.com  2006-09-16 13:19 -------
I filed this bug a while ago and have since changed jobs so I cannot reproduce
it. However from what I recall I was using <jspversion>2.0</jspversion>. 
It is unclear from your comment but are you trying to say that TagHandlerPool is
only used for older versions of JSP? 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 39966] - Class Cast Exception inTagHandlerPool

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39966





------- Additional Comments From scott@indosoft.ca  2006-09-15 16:33 -------
> Should it be checking to see if it is a SimpleTag and converting it using a
> TagAdapter on line 116?

SimpleTagSupport iirc wasn't added until JSP 2.0.  Make sure you specify
<jspversion>2.0</jspversion>

in your TLD.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 39966] - Class Cast Exception inTagHandlerPool

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39966>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39966





------- Additional Comments From scott@indosoft.ca  2006-09-16 23:15 -------
(In reply to comment #2)
> I filed this bug a while ago and have since changed jobs so I cannot reproduce
> it. However from what I recall I was using <jspversion>2.0</jspversion>. 
> It is unclear from your comment but are you trying to say that TagHandlerPool is
> only used for older versions of JSP? 

Nope, just saying I had the exact same problem.  As far as I can tell,
TagHandlerPool is still used, but the overall handling of tags is slightly
different in 2.0 (interface JspTag was shunted to be a superinterface of Tag). 
So I think if you specify <2.0 in the TLD, the translator will go ahead and
expect the Tag interface in your custom tags.  It'll use TagAdapter to link them
both together (so getParent() works properly when you mix and match
SimpleTag[Support] subclasses with implementors of Tag).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org