You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Andreas <ic...@yahoo.ca> on 2010/02/18 15:21:20 UTC

Logging Issue with Tiles 2.1.3

Hi,
we recently migrated from Spring 2.5.6 and Tiles 2.0.5 to Spring 3.0 and Tiles 2.1.3.
For logging we use log4j.

After the migration, Errors from ExpressionLanguage do not show up in the console or application configured logfile anymore. Instead the default tiles-errorpage is displayed.

Example to illustrate my issue:
Correct would be:

<c:set var="test" value="${something.test}" />

By accident within the JSP you end up with:

<c:set var="test" value="${something.test2}" />

With Spring 2.5.6 and tiles 2.0.5 this resulted in a nice stacktrace in the console with lots of useful hints.

[ERROR] [2010-02-17 19:07:23] (jsp.taglib.RenderTagSupport) Error during rendering
javax.servlet.jsp.JspException: ServletException while including page.
	at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:102)
	at org.apache.tiles.jsp.taglib.InsertTemplateTag.render(InsertTemplateTag.java:64)
	at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
	at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
	at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
	at org.apache.jsp.jsp.Navigation_jsp._jspx_meth_tiles_005finsertTemplate_005f0(Navigation_jsp.java:307)
	at org.apache.jsp.jsp.Navigation_jsp._jspx_meth_c_005fif_005f1(Navigation_jsp.java:279)
	at org.apache.jsp.jsp.Navigation_jsp._jspService(Navigation_jsp.java:97)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
	at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:650)
	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:644)
	at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:87)
	at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:88)
	at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:465)
	at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:140)
	at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:117)
	at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
	at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
	at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
	at org.apache.jsp.jsp.layouts.standard_jsp._jspx_meth_tiles_005finsertAttribute_005f0(standard_jsp.java:1620)
	at org.apache.jsp.jsp.layouts.standard_jsp._jspService(standard_jsp.java:464)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
	at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
	at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:75)
	at org.springframework.js.ajax.tiles2.AjaxTilesView.renderMergedOutputModel(AjaxTilesView.java:115)
	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:257)
	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1183)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:902)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Caused by: org.apache.jasper.JasperException: An exception occurred processing JSP page /jsp/Test.jsp at line 7
4: 
5: <c:set var="a" value="b" />
6: <%-- Test --%>
7: <c:set var="test" value="${something.test}" />
8: 
Stacktrace:
	at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:621)
	at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:98)
	... 110 more
Caused by: javax.el.PropertyNotFoundException: Property 'test2' not found on type org.whatever.blah.something
	at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
	at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
	at javax.el.BeanELResolver.property(BeanELResolver.java:279)
	at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
	at org.apache.el.parser.AstValue.getValue(AstValue.java:118)
	at org.apache.el.parser.AstOr.getValue(AstOr.java:42)
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
	at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)
	at org.apache.jsp.jsp.Menu_jsp._jspx_meth_c_005fif_005f0(Menu_jsp.java:256)
	at org.apache.jsp.jsp.Menu_jsp._jspService(Menu_jsp.java:80)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	... 121 more

With Spring 3.0 and Tiles 2.1.3 i only get fewer information and i only get them within the TOMCAT_HOME/logs/localhost_XX.log:

SEVERE: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'test2' not found on type org.whatever.blah.something
	at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
	at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
	at javax.el.BeanELResolver.property(BeanELResolver.java:279)

Probably a tiles issue. I could imagine that tiles catches the exception that happened within a tile without re-throwing the exception.

Anyone else experienced similar problems or knows a solution?

The only things i changed are the spring and tiles libs, no logging configuration was changed.

I also posted my problem at the spring forums: http://forum.springsource.org/showthread.php?p=284518#post284518

Any help is greatly appreciated 

Best Regards
Andreas


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

Re: Logging Issue with Tiles 2.1.3

Posted by Antonio Petrelli <an...@gmail.com>.
2010/2/18 Andreas <ic...@yahoo.ca>:
> we recently migrated from Spring 2.5.6 and Tiles 2.0.5 to Spring 3.0 and Tiles 2.1.3.

First of all try using Tiles 2.1.4.

> With Spring 3.0 and Tiles 2.1.3 i only get fewer information and i only get them within the TOMCAT_HOME/logs/localhost_XX.log:
>
> SEVERE: Servlet.service() for servlet jsp threw exception
> javax.el.PropertyNotFoundException: Property 'test2' not found on type org.whatever.blah.something
>        at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
>        at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
>        at javax.el.BeanELResolver.property(BeanELResolver.java:279)
>
> Probably a tiles issue. I could imagine that tiles catches the exception that happened within a tile without re-throwing the exception.

Not necessarily, probably Tiles simply does not take care of the
exception as it did (probably) in 2.0.x.
And a longer stack trace does not mean that it is better (in your case
it is an EL error in a JSP page, Tiles is not involved).
However feel free to create a JIRA issue attaching a test case (a
Maven war project would be great).

Antonio