Mantis - Resin
Viewing Issue Advanced Details
3956 minor always 03-19-10 19:19 03-22-10 12:51
rmann  
 
normal  
closed  
fixed  
none    
none 4.0.5  
0003956: resin incorrectly builds JSP tag classes
I have a JSP tag that invokes the fmt:formatNumber tag. When resin generates the Java for this tag, it attempts to set my tag's instance as the parent of the format number instance. To do this, it attempts to cast it to a javax.servlet.jsp.tagext.Tag. Unfortunately, the class my tag inherits is com.caucho.jsp.java.JspTagSupport, which inherits ultimately JspTag, not Tag, which is what it's trying to cast to.

I've enclosed the generated Java. The offending line is 0000213.

As near as I can tell, my tag's inheritance chain is:

_jsp._WEB_22dINF._tags._lz._durT__tag extends
com.caucho.jsp.java.JspTagSupport extends
com.caucho.jsp.java.JspTagSupport extends
javax.servlet.jsp.tagext.SimpleTagSupport (extends java.lang.Object, implements javax.servlet.jsp.tagext.SimpleTag)

javax.servlet.jsp.tagext.SimpleTag extends javax.servlet.jsp.tagext.JspTag extends nothing.

And it's calling com.caucho.jstl.rt.FormatNumberTag.setParent(), which is really
javax.servlet.jsp.tagext.BodyTagSupport.setParent(), which is really
javax.servlet.jsp.tagext.TagSupport.setParent(javax.servlet.jsp.tagext.Tag).

javax.servlet.jsp.tagext.Tag inherits from javax.servlet.jsp.tagext.JspTag

So, while they both have a common parent interface in JspTag, the case is from one branch to another under that.

Stack trace of the exception:

[03-19 18:44:38.037] {http://*:80-6} [^] WARNING (com.caucho.server.webapp.ErrorPageManager) javax.servlet.ServletException: javax.servlet.ServletException: com.caucho.jsp.QJspException: java.lang.ClassCastException: _jsp._WEB_22dINF._tags._lz._durT__tag cannot be cast to javax.servlet.jsp.tagext.Tag
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
[03-19 18:44:38.037] {http://*:80-6} [^] at javax.servlet.http.HttpServlet.service(HttpServlet.java:119)
[03-19 18:44:38.037] {http://*:80-6} [^] at javax.servlet.http.HttpServlet.service(HttpServlet.java:96)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:109)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.latencyzero.satdb.RequestFilter.doFilter(RequestFilter.java:124)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:88)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:88)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.latencyzero.satdb.SecurityFilter.doFilter(SecurityFilter.java:215)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:88)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866)
[03-19 18:44:38.037] {http://*:80-6} [^] Caused by: javax.servlet.ServletException: com.caucho.jsp.QJspException: java.lang.ClassCastException: _jsp._WEB_22dINF._tags._lz._durT__tag cannot be cast to javax.servlet.jsp.tagext.Tag
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.jsp.PageContextImpl.handlePageException(PageContextImpl.java:1255)
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._jsp._mission__jsp._jspService(_mission__jsp.java:30)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.jsp.Page.pageservice(Page.java:535)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:195)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:283)
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:121)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
[03-19 18:44:38.037] {http://*:80-6} [^] at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
[03-19 18:44:38.037] {http://*:80-6} [^] ... 24 more
[03-19 18:44:38.037] {http://*:80-6} [^] Caused by: com.caucho.jsp.QJspException: java.lang.ClassCastException: _jsp._WEB_22dINF._tags._lz._durT__tag cannot be cast to javax.servlet.jsp.tagext.Tag
[03-19 18:44:38.037] {http://*:80-6} [^] at com.caucho.jsp.QJspException.createJspException(QJspException.java:74)
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._tags._lz._durT__tag.doTag(_durT__tag.java:39)
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._jsp._mission__jsp._jspService(_mission__jsp.java:194)
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._jsp._mission__jsp._jspService(_mission__jsp.java:28)
[03-19 18:44:38.037] {http://*:80-6} [^] ... 38 more
[03-19 18:44:38.037] {http://*:80-6} [^] Caused by: java.lang.ClassCastException: _jsp._WEB_22dINF._tags._lz._durT__tag cannot be cast to javax.servlet.jsp.tagext.Tag
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._tags._lz._durT__tag$TagState.get_jsp_FormatNumberTag_0(_durT__tag.java:213)
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._tags._lz._durT__tag.doTag(_durT__tag.java:90)
[03-19 18:44:38.037] {http://*:80-6} [^] at _jsp._WEB_22dINF._tags._lz._durT__tag.doTag(_durT__tag.java:35)
[03-19 18:44:38.037] {http://*:80-6} [^] ... 40 more
 tagcast.zip [^] (4,147 bytes) 03-19-10 19:19

Notes
(0004477)
alex   
03-22-10 08:45   
Rick, 4.0.5 has had many changes done to JSP generation in the area of tag generation. We also run JSP TCK against it. There may still be errors that we did not catch but you may want to go straight to 4.0.5, the problem is very likely to have been fixed in that version.
(0004478)
rmann   
03-22-10 12:38   
I'd love to go to 4.0.5, but it won't stay up. It dies after less than an hour.
(0004479)
rmann   
03-22-10 12:45   
I can verify the the tag issue is fixed in 4.0.5. Now, if I can just rely on 4.0.5 staying up. I fails to run for long on both my old Linux RH 7.2, and my new Nexenta/OpenSolaris. 4.0.4 runs solidly.
(0004480)
alex   
03-22-10 12:50   
OK. I'll close this issue then. Can you open a new one with the 'finest' logs from your unstable 4.0.5 (resin.xml/resin/log/level finest for com.caucho). Please attach the configuration too. Also, when you start resin please make sure to supply -verbose, that way we get more info on your environment. Thanks a bunch!