PDA

View Full Version : JSTL EL broken in Resin 4.1?


Colojo
12-12-2010, 10:33 PM
I have a Java class that manages paging when I display long lists of records. It stores a request-scoped variable called "offset" that my JSP's use to determine which section of a long list of records to display. Here's the relevant line of code in one of my JSP's:

<c:forEach var="emailTemplate" begin="${offset}" end="${offset+(length-1)}" items="${emailTemplateForm.map.emailTemplates}" varStatus="status" >

Everything works fine with Resin 3.1.x, but I'm trying to upgrade to Resin 4.0.13 and the line of code generates the following error:

parameter format error: For input string: "${offset}"

Any ideas on how to fix this?

Thanks.

alex
12-13-2010, 11:17 PM
Hi Colojo,

Can you check resin's log for any stack trace on the error?

is the ${offset} a number?

Thanks,
Alex

Colojo
12-14-2010, 04:31 PM
Yes, offset is an int.

Here's the stack trace:

[10:29:44.870] {server://127.0.0.1:6800-5} java.lang.NoSuchMethodError: com.caucho.make.ClassDependency.<init>(Ljava/lang/Class;J)V
at _jsp._jsp._listelementtypelistbody__jsp.init(_list elementtypelistbody__jsp.java:473)
at com.caucho.jsp.JspManager.preload(JspManager.java: 354)
at com.caucho.jsp.JspManager.compile(JspManager.java: 234)
at com.caucho.jsp.JspManager.createPage(JspManager.ja va:187)
at com.caucho.jsp.JspManager.createPage(JspManager.ja va:168)
at com.caucho.jsp.PageManager.getPage(PageManager.jav a:339)
at com.caucho.jsp.PageManager.getPage(PageManager.jav a:269)
at com.caucho.jsp.PageManager.getPage(PageManager.jav a:252)
at com.caucho.jsp.QServlet.getSubPage(QServlet.java:2 94)
at com.caucho.jsp.QServlet.getPage(QServlet.java:210)
at com.caucho.server.dispatch.PageFilterChain.compile Page(PageFilterChain.java:240)
at com.caucho.server.dispatch.PageFilterChain.doFilte r(PageFilterChain.java:144)
at com.caucho.server.cache.ProxyCacheFilterChain.doFi lter(ProxyCacheFilterChain.java:206)
at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:287)
at com.caucho.server.webapp.RequestDispatcherImpl.inc lude(RequestDispatcherImpl.java:410)
at com.caucho.server.webapp.RequestDispatcherImpl.inc lude(RequestDispatcherImpl.java:329)
at com.caucho.jsp.PageContextImpl.include(PageContext Impl.java:1076)
at com.caucho.jsp.PageContextImpl.include(PageContext Impl.java:952)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(Ti lesUtilImpl.java:137)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesU til.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude (InsertTag.java:756)
at org.apache.struts.taglib.tiles.InsertTag$InsertHan dler.doEndTag(InsertTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag( InsertTag.java:473)
at _jsp._jsp._setuplayout__jsp._jspService(_setuplayo ut__jsp.java:186)
at _jsp._jsp._setuplayout__jsp._jspService(_setuplayo ut__jsp.java:33)
at com.caucho.jsp.JavaPage.service(JavaPage.java:64)
at com.caucho.jsp.Page.pageservice(Page.java:542)
at com.caucho.server.dispatch.PageFilterChain.doFilte r(PageFilterChain.java:194)
at com.caucho.server.cache.ProxyCacheFilterChain.doFi lter(ProxyCacheFilterChain.java:148)
at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:287)
at com.caucho.server.webapp.RequestDispatcherImpl.inc lude(RequestDispatcherImpl.java:410)
at com.caucho.server.webapp.RequestDispatcherImpl.inc lude(RequestDispatcherImpl.java:329)
at com.caucho.jsp.PageContextImpl.include(PageContext Impl.java:1076)
at com.caucho.jsp.PageContextImpl.include(PageContext Impl.java:952)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(Ti lesUtilImpl.java:137)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesU til.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude (InsertTag.java:756)
at org.apache.struts.taglib.tiles.InsertTag$InsertHan dler.doEndTag(InsertTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag( InsertTag.java:473)
at _jsp._listelementtypelist__jsp._jspService(_listel ementtypelist__jsp.java:222)
at _jsp._listelementtypelist__jsp._jspService(_listel ementtypelist__jsp.java:29)
at com.caucho.jsp.JavaPage.service(JavaPage.java:64)
at com.caucho.jsp.Page.pageservice(Page.java:542)
at com.caucho.server.dispatch.PageFilterChain.doFilte r(PageFilterChain.java:194)
at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:287)
at com.caucho.server.webapp.RequestDispatcherImpl.for ward(RequestDispatcherImpl.java:270)
at com.caucho.server.webapp.RequestDispatcherImpl.for ward(RequestDispatcherImpl.java:100)
at org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doFo rward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.processF orwardConfig(RequestProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.proc essForwardConfig(TilesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:96)
at com.caucho.server.dispatch.ServletFilterChain.doFi lter(ServletFilterChain.java:109)
at com.caucho.server.webapp.WebAppFilterChain.doFilte r(WebAppFilterChain.java:183)
at com.caucho.server.cache.ProxyCacheFilterChain.doFi lter(ProxyCacheFilterChain.java:148)
at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:287)
at com.caucho.server.hmux.HmuxRequest.handleInvocatio n(HmuxRequest.java:476)
at com.caucho.server.hmux.HmuxRequest.handleRequestIm pl(HmuxRequest.java:381)
at com.caucho.server.hmux.HmuxRequest.handleRequest(H muxRequest.java:347)
at com.caucho.network.listen.TcpSocketLink.dispatchRe quest(TcpSocketLink.java:675)
at com.caucho.network.listen.TcpSocketLink.handleRequ estsImpl(TcpSocketLink.java:637)
at com.caucho.network.listen.TcpSocketLink.handleRequ ests(TcpSocketLink.java:588)
at com.caucho.network.listen.TcpSocketLink$AcceptTask .doTask(TcpSocketLink.java:1175)
at com.caucho.network.listen.TcpSocketLink$Connection ReadTask.runThread(TcpSocketLink.java:1108)
at com.caucho.network.listen.TcpSocketLink$AcceptTask .run(TcpSocketLink.java:1142)
at com.caucho.env.thread.ResinThread.runTasks(ResinTh read.java:182)
at com.caucho.env.thread.ResinThread.run(ResinThread. java:126)

alex
12-14-2010, 04:46 PM
This particular error caused by classes compiled against older version of resin. Can you remove the WEB-INF/work directory? Resin puts all generated .java code there by default unless it's redefined in <work-dir> or @work-dir under the web-app tag.

Colojo
12-14-2010, 05:45 PM
OK, I quit Resin, deleted the Work directory and then restarted Resin. At startup, when it's precompiling my JSP's, it generates the same error I originally reported for each JSP containing this code.

alex
12-14-2010, 05:49 PM
I see... Can you send me your elementtypelistbody__jsp.java or other file that has this error (alex at caucho.com) or here?

Also, do you see the same problem when compile listener isn't used?

Thanks,
ALex

Colojo
12-14-2010, 06:26 PM
Disabling the compile listener makes the error messages go away at startup, but the problem is still there. I deleted the work directory again and restarted, but when I go to the page I emailed you I still get this error (reported on the page itself):

[ServletException in:/jsp/roleListBody.jsp] For input string: "${offset}"

Nothing was displayed on the Resin console. I have logging set to "fine."

alex
12-14-2010, 06:41 PM
Message "For input string: "${offset}" doesn't look like resin's message to me.
Can you check if this may be a custom message?
Thanks,
Alex

Colojo
12-14-2010, 06:56 PM
Not one of ours. Must be part of JSP or Java.

alex
12-14-2010, 07:13 PM
The JSP and JSTL are Resin's implementations but I don't see corresponding message parts in our code.

What's printing [ServletException in:/jsp/roleListBody.jsp] For input string: "${offset}" ?

Can you add a printStackTrace for the ServletException in the above?

Thanks,
alex

Colojo
12-14-2010, 07:32 PM
I don't know. It just shows up in the browser and is embedded in the page source. I'll try to get a stack trace somehow.

Colojo
12-14-2010, 07:38 PM
BTW, we're using Struts 1.2 and Tiles. Maybe one of them is generating the message, or maybe one of the taglibs.

alex
12-14-2010, 10:50 PM
Update:
The problem was a custom c.tld that was registered for the c prefix. That had conflict between definition and implementation.

Resolution:
If you are running into similar problems with jstl core libraries make sure that resin's library is used for JSTL
– remove standart.jar and jstl.jar from WEB-INF/lib
– remove mapping for core jstl tlds from your WEB-INF/web.xml and WEB-INF/resin-web.xml
– make sure to use correct uri for core libraries in your jsps
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>