Struts 2
  1. Struts 2
  2. WW-4223

<s:debug/> tag throws NPE when used with Jetty

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.15
    • Fix Version/s: 2.3.16
    • Component/s: Plugin - Tags
    • Labels:
      None

      Description

      When used with Tomcat everything works, but when used with Jetty it throws NPE:

       org.apache.jasper.JasperException: Class: org.apache.jasper.compiler.TagLibraryInfoImpl File: TagLibraryInfoImpl.java Method: toString Line: 129 - org/apache/jasper/compiler/TagLibraryInfoImpl.java:129:-1
      
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:440)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
          org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:526)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
          org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:586)
          org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
          org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
          org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
          org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
          org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
          org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
          org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
          org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)
          org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
          com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
          org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
          org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
          org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563)
          org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
          org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
          org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1544)
          org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
          org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
          org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
          org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
          org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
          org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
          org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
          org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:200)
          org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
          org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
          org.eclipse.jetty.server.Server.handle(Server.java:445)
          org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:278)
          org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:216)
          org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
          org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
          org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
          java.lang.Thread.run(Thread.java:724)
          
      
      Class: org.apache.jasper.compiler.TagLibraryInfoImpl File: TagLibraryInfoImpl.java Method: toString Line: 129 - org/apache/jasper/compiler/TagLibraryInfoImpl.java:129:-1
      
          org.apache.struts2.components.UIBean.end(UIBean.java:528)
          org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
          org.apache.jsp.index_jsp._jspx_meth_s_debug_0(index_jsp.java:227)
          org.apache.jsp.index_jsp._jspService(index_jsp.java:81)
          org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
          org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:526)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
          org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:586)
          org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
          org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
          org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
          org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
          org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
          org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
          org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
          org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)
          org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
          com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
          org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
          org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
          org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563)
          org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
          org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
          org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1544)
          org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
          org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
          org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
          org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
          org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
          org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
          org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
          org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:200)
          org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
          org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
          org.eclipse.jetty.server.Server.handle(Server.java:445)
          org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:278)
          org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:216)
          org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
          org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
          org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
          java.lang.Thread.run(Thread.java:724)
          
      
      java.lang.NullPointerException
      
          org.apache.jasper.compiler.TagLibraryInfoImpl.toString(TagLibraryInfoImpl.java:129)
          java.lang.String.valueOf(String.java:2854)
          java.lang.StringBuilder.append(StringBuilder.java:128)
          java.util.AbstractMap.toString(AbstractMap.java:523)
          java.lang.String.valueOf(String.java:2854)
          java.lang.StringBuilder.append(StringBuilder.java:128)
          java.util.AbstractMap.toString(AbstractMap.java:523)
          java.lang.String.valueOf(String.java:2854)
          java.lang.StringBuffer.append(StringBuffer.java:232)
          freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
          freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
          freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
          freemarker.core.Expression.getStringValue(Expression.java:93)
          freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
          freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
          freemarker.core.Expression.getStringValue(Expression.java:93)
          freemarker.core.DollarVariable.accept(DollarVariable.java:76)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.IfBlock.accept(IfBlock.java:82)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.MixedContent.accept(MixedContent.java:92)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
          freemarker.core.Environment.visit(Environment.java:428)
          freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.MixedContent.accept(MixedContent.java:92)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.Environment.include(Environment.java:1508)
          freemarker.core.Include.accept(Include.java:169)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.MixedContent.accept(MixedContent.java:92)
          freemarker.core.Environment.visit(Environment.java:221)
          freemarker.core.Environment.process(Environment.java:199)
          freemarker.template.Template.process(Template.java:259)
          org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
          org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572)
          org.apache.struts2.components.UIBean.end(UIBean.java:526)
          org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
          org.apache.jsp.index_jsp._jspx_meth_s_debug_0(index_jsp.java:227)
          org.apache.jsp.index_jsp._jspService(index_jsp.java:81)
          org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
          org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:526)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
          org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:586)
          org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
          org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
          org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
          org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
          org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
          org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
          org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
          org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)
          org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
          com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
          org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
          org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
          com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
          com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
          org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
          org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563)
          org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
          org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
          org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1544)
          org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
          org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
          org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
          org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
          org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
          org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
          org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
          org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
          org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:200)
          org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
          org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
          org.eclipse.jetty.server.Server.handle(Server.java:445)
          org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:278)
          org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:216)
          org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
          org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
          org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
          java.lang.Thread.run(Thread.java:724)
          
      
      1. WW-4223.patch
        3 kB
        Yasser Zamani

        Activity

        Hide
        Yasser Zamani added a comment -

        I discovered the source of the problem. It seems that there is no problem with Struts itself but when you run a Struts application on:

        • Jetty: TagLibraryInfoImpl class will be resolved from jetty home/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar where line #129 is:
          TagLibraryInfoImpl.java:129
          print("tagLibraryValidator", tagLibraryValidator.toString(), out);
          

          but in

        • Tomcat: TagLibraryInfoImpl class will be resolved from tomcat home/lib/jasper.jar where equivalent code at line #94 is:
          TagLibraryInfoImpl.java:94
          print("tagLibraryValidator", "" + tagLibraryValidator, out);
          

        These facts show that when tagLibraryValidator is null, Jetty will be broken by NPE (because of tagLibraryValidator.toString()) but Tomcat continues well (because of "" + tagLibraryValidator).

        Show
        Yasser Zamani added a comment - I discovered the source of the problem. It seems that there is no problem with Struts itself but when you run a Struts application on: Jetty: TagLibraryInfoImpl class will be resolved from jetty home/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar where line #129 is: TagLibraryInfoImpl.java:129 print( "tagLibraryValidator" , tagLibraryValidator.toString(), out); but in Tomcat: TagLibraryInfoImpl class will be resolved from tomcat home/lib/jasper.jar where equivalent code at line #94 is: TagLibraryInfoImpl.java:94 print( "tagLibraryValidator" , "" + tagLibraryValidator, out); These facts show that when tagLibraryValidator is null, Jetty will be broken by NPE (because of tagLibraryValidator.toString() ) but Tomcat continues well (because of "" + tagLibraryValidator ).
        Hide
        Lukasz Lenart added a comment -

        Yes, exactly that's the problem and we must find some solution.

        Show
        Lukasz Lenart added a comment - Yes, exactly that's the problem and we must find some solution.
        Hide
        Yasser Zamani added a comment -

        As my today working, the problem occurs here:

        /struts2/core/src/main/resources/template/simple/debug.ftl:76
                <td>${contextKey}</td><td><#if stack.context.get(contextKey)??>${stack.context.get(contextKey).toString()?html}<#else>null</#if></td>
        

        Actually we must put stack.context.get(contextKey).toString()?html in try/catch someway to skip unsafe .toString() methods. I tried:

        /struts2/core/src/main/resources/template/simple/debug.ftl:76
                <td>${contextKey}</td><td><#if stack.context.get(contextKey)??><#attempt>${stack.context.get(contextKey).toString()?html}<#recover><font color="red">ERROR: ${.error}</font></#attempt><#else>null</#if></td>
        

        but unfortunately, Freemarker's attemp/recover directive does not work in this situation! It works well in a situation like stack.context.get(contextKey).getClass().toString().substring(null)?html.

        I thought these may help if someone already works on this issue. However, I'll work on this Freemarker's behavior tomorrow too

        Show
        Yasser Zamani added a comment - As my today working, the problem occurs here: /struts2/core/src/main/resources/template/simple/debug.ftl:76 <td>${contextKey}</td><td><# if stack.context.get(contextKey)??>${stack.context.get(contextKey).toString()?html}<# else > null </# if ></td> Actually we must put stack.context.get(contextKey).toString()?html in try/catch someway to skip unsafe .toString() methods . I tried: /struts2/core/src/main/resources/template/simple/debug.ftl:76 <td>${contextKey}</td><td><# if stack.context.get(contextKey)??><#attempt>${stack.context.get(contextKey).toString()?html}<#recover><font color= "red" >ERROR: ${.error}</font></#attempt><# else > null </# if ></td> but unfortunately, Freemarker's attemp/recover directive does not work in this situation! It works well in a situation like stack.context.get(contextKey).getClass().toString().substring(null)?html . I thought these may help if someone already works on this issue. However, I'll work on this Freemarker's behavior tomorrow too
        Hide
        Yasser Zamani added a comment -

        I've done some solution and have tested with latest code from repository. It works well

        I tried to attach it's patch here but the issue does not show the attached file. Is it waiting for moderation?

        Solution:

        freemarker <#attempt> directive has been used in debug.ftl to skip unsafe toString() methods with an error message. A custom freemarker directive (RaiseAllExceptionsDirective) has been added to convert Exception to TemplateException because <#attempt> directive is only aware with TemplateException.

        Show
        Yasser Zamani added a comment - I've done some solution and have tested with latest code from repository. It works well I tried to attach it's patch here but the issue does not show the attached file. Is it waiting for moderation? Solution: freemarker <#attempt> directive has been used in debug.ftl to skip unsafe toString() methods with an error message. A custom freemarker directive (RaiseAllExceptionsDirective) has been added to convert Exception to TemplateException because <#attempt> directive is only aware with TemplateException .
        Hide
        Lukasz Lenart added a comment -

        The patch is above, under Attachments section. Thanks!

        Show
        Lukasz Lenart added a comment - The patch is above, under Attachments section. Thanks!
        Hide
        Yasser Zamani added a comment - - edited

        You're welcome, I'm enjoying the contribute back so much
        It seems it's taking a few minutes for Jira to show file attachments which I did not know, sorry.

        Lukasz Lenart, I'm not completely satisfied with my newly added directive's name, RaiseAllExceptionsDirective. Because, I think this name does not describe the directive's functionality completely, so, I wish to correct it before you commit. I thought about:

        • RaiseExceptionsAsTemplateExceptionsDirective
        • ConvertExceptionsToTemplateExceptionsDirective
        • E2TEDirective

        but as you see, they're too long or too short. Also, generally what I should consider with newly added files? e.g. how to apply Apache license into file, etc.

        Thanks in advance!

        Show
        Yasser Zamani added a comment - - edited You're welcome, I'm enjoying the contribute back so much It seems it's taking a few minutes for Jira to show file attachments which I did not know, sorry. Lukasz Lenart , I'm not completely satisfied with my newly added directive's name, RaiseAllExceptionsDirective . Because, I think this name does not describe the directive's functionality completely, so, I wish to correct it before you commit. I thought about: RaiseExceptionsAsTemplateExceptionsDirective ConvertExceptionsToTemplateExceptionsDirective E2TEDirective but as you see, they're too long or too short. Also, generally what I should consider with newly added files? e.g. how to apply Apache license into file, etc. Thanks in advance!
        Hide
        ASF subversion and git services added a comment -

        Commit 1534977 from Lukasz Lenart in branch 'struts2/trunk'
        [ https://svn.apache.org/r1534977 ]

        WW-4223 Uses safe toString method to avoid exception during generating debug info

        Show
        ASF subversion and git services added a comment - Commit 1534977 from Lukasz Lenart in branch 'struts2/trunk' [ https://svn.apache.org/r1534977 ] WW-4223 Uses safe toString method to avoid exception during generating debug info
        Hide
        Lukasz Lenart added a comment -

        Thanks for the patch, I have used it as an inspiration!

        Show
        Lukasz Lenart added a comment - Thanks for the patch, I have used it as an inspiration!
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Struts2-JDK6 #823 (See https://builds.apache.org/job/Struts2-JDK6/823/)
        WW-4223 Uses safe toString method to avoid exception during generating debug info (lukaszlenart: rev 1534977)

        • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/AttributeMap.java
        • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java
        • /struts/struts2/trunk/core/src/main/resources/template/simple/debug.ftl
        Show
        Hudson added a comment - SUCCESS: Integrated in Struts2-JDK6 #823 (See https://builds.apache.org/job/Struts2-JDK6/823/ ) WW-4223 Uses safe toString method to avoid exception during generating debug info (lukaszlenart: rev 1534977) /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/AttributeMap.java /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/StrutsUtil.java /struts/struts2/trunk/core/src/main/resources/template/simple/debug.ftl

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Lukasz Lenart
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development