Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4455

JSP function lookup is broken if EL expression contains map or set literal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.0.0.Alpha3
    • 8.2.0.Final
    • None
    • Hide

      1) Deploy the attached application.
      2) Go to http://localhost:8080/jsp-bug/test.jsp
      3) Observe "Internal Stack Error" returned from server as HTML and the stacktrace in WildFly log.

      Show
      1) Deploy the attached application. 2) Go to http://localhost:8080/jsp-bug/test.jsp 3) Observe "Internal Stack Error" returned from server as HTML and the stacktrace in WildFly log.

      The attached trivial applications consists of 'test.jsp' and 'WEB-INF/bug.tld' files. The latter includes only one function mapped from the standard Java library. It is not relevant what it does, only that it is mapped. File 'test.jsp' contains this expession:

      ${{}; bug:dummy()}

      Please note that without '{};' (if it is removed or e.g. replaced with '1 it works correctly, printing something like 'java.lang.Runtime@...'. (In my real application this is 'my:function1 (

      { x: y }

      ) && my:function2 (...)'. Lookup of the first function succeeds, but lookup of the second one fails. If I replace map literal with something else, expression is compiled just fine.)

      However, if expression contains set (or map) literal, JSP compiler fails with this exception:

      15:05:24,317 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /jsp-bug/test.jsp: org.apache.jasper.JasperException: JBWEB004038: An exception occurred processing JSP page /test.jsp at line 7
      
      4:   </head>
      5: 
      6:   <body>
      7:     ${{}; bug:dummy()}
      8:   </body>
      9: </html>
      
      
      Stacktrace:
              at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:494) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
      Caused by: java.lang.NullPointerException
              at org.apache.jasper.el.FunctionMapperImpl.resolveFunction(FunctionMapperImpl.java:32) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at com.sun.el.lang.FunctionMapperFactory.resolveFunction(FunctionMapperFactory.java:71) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.lang.ExpressionBuilder.visit(ExpressionBuilder.java:272) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.parser.SimpleNode.accept(SimpleNode.java:172) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.parser.SimpleNode.accept(SimpleNode.java:175) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.lang.ExpressionBuilder.prepare(ExpressionBuilder.java:227) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:238) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:295) [javax.el-3.0.1-b05.jar:]
              at com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:112) [javax.el-3.0.1-b05.jar:]
              at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:897) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.jsp.test_jsp._jspService(test_jsp.java:61)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jastow-1.0.0.Final.jar:1.0.0.Final]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366) [jastow-1.0.0.Final.jar:1.0.0.Final]
              ... 29 more
      

        1. jsp-bug.war
          1 kB
          Paul Pogonyshev
        2. jsp-bug.war
          1 kB
          Paul Pogonyshev

              tomazcerar Tomaž Cerar (Inactive)
              doublep_ Paul Pogonyshev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: