9 Replies Latest reply on Oct 1, 2019 11:17 AM by t0920008899

    JSP in WildFly

    t0920008899

      Hi,

       

      I have a JSP-based application which ran well in JBoss EAP 6.4. Hwoever, trying to run on WildFly 17, the jsp could not get run with error message suggesting that custom tag lib files could not get loaded. Any configurations I need to make to this run? Please kindly advise.

       

      Best regards,

      Joey

        • 1. Re: JSP in WildFly
          mayerw01

          Post post your server.log containing the detailed error messages

          • 2. Re: JSP in WildFly
            t0920008899

            Hi,

             

            The errors:

            ----------------------------------------------------------------------------------------

            2019-10-01 17:54:47,496 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 101) WFLYUT0021: Registered web context: '/ADRVanguard' for server 'default-server'

            2019-10-01 17:54:47,528 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed "ADRVanguard.ear" (runtime-name : "ADRVanguard.ear")

            2019-10-01 17:54:48,663 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /ADRVanguard/logon.jsp: javax.servlet.ServletException: java.lang.NoSuchFieldError: value

            at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:889)

            at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:818)

            at org.apache.jsp.logon_jsp._jspService(logon_jsp.java:941)

            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)

            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)

            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)

            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)

            at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)

            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

            at com.softvanguard.servlet.filter.RejectRequest.doFilter(RejectRequest.java:148)

            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

            at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:55)

            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

            at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

            at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

            at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)

            at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

            at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

            at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)

            at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

            at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

            at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

            at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

            at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

            at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

            at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)

            at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

            at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

            at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

            at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

            at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

            at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

            at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

            at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

            at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

            at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

            at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

            at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)

            at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

            at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

            at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)

            at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)

            at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)

            at java.lang.Thread.run(Thread.java:748)

            Caused by: java.lang.NoSuchFieldError: value

            at org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)

            at org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)

            at org.apache.jsp.logon_jsp._jspx_meth_c_005fout_005f0(logon_jsp.java:978)

            at org.apache.jsp.logon_jsp._jspService(logon_jsp.java:178)

            ... 57 more

            --------------------------------------------------------------------------------------------------------------------------

             

            When I changed the web.xml definition to version 4.0, another kind of error showed up saying that "JBWEB004195: According to TLD or attribute directive in tag file, attribute value does not accept any expressions". I am using WildFly 17.0.1. Please kindly advise.

             

            Best regards,

            Joey

            • 3. Re: JSP in WildFly
              mayerw01

              It looks like some of your class files are out of date. Did you re compile your application?

              • 4. Re: JSP in WildFly
                t0920008899

                Yes, I recompiled and re-built the artifact. Don't know which class files should be updated.

                 

                Best regards,

                Joey

                • 5. Re: JSP in WildFly
                  t0920008899

                  Hello,

                   

                  Here comes the errors when I changed the web-app version definition in web.xml to version 3.0.

                  ----------------------------------------------------------------------------------------

                  2019-10-01 19:02:04,446 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 86) WFLYUT0021:

                  Registered web context: '/ADRVanguard' for server 'default-server'

                  2019-10-01 19:02:04,476 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed "ADRVanguard.ear" (runtime-name : "ADRVanguard.ear")

                  2019-10-01 19:02:05,080 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /ADRVanguard/logon.jsp: org.apache.jasper.JasperException: /logon.jsp (JBWEB004251: An error occurred at line: 44 column: 8) JBWEB004195: According to TLD or attribute directive in tag file, attribute value does not accept any expressions

                  at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:45)

                  at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:276)

                  at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:107)

                  at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1214)

                  at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:855)

                  at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1535)

                  at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)

                  at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)

                  at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2433)

                  at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)

                  at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2375)

                  at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1834)

                  at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:218)

                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)

                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)

                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)

                  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:652)

                  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)

                  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)

                  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)

                  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

                  at com.softvanguard.servlet.filter.RejectRequest.doFilter(RejectRequest.java:148)

                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

                  at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:55)

                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

                  at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

                  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                  at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)

                  at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

                  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)

                  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

                  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

                  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

                  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

                  at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                  at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)

                  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

                  at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

                  at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

                  at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

                  at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

                  at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

                  at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

                  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

                  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

                  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

                  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)

                  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

                  at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

                  at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)

                  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)

                  at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)

                  at java.lang.Thread.run(Thread.java:748)

                  --------------------------------------------------------------------------------

                   

                  I checked all my class files, and found no one is related to jsp servlet. Please kindly advise.

                   

                  Best regards,

                  Joey

                  • 6. Re: JSP in WildFly
                    ctomc

                    UT005023: Exception handling request to /ADRVanguard/logon.jsp: org.apache.jasper.JasperException: /logon.jsp (JBWEB004251: An error occurred at line: 44 column: 8) JBWEB004195: According to TLD or attribute directive in tag file, attribute value does not accept any expressions

                    look at your logon.jsp line 44 to see what taglib you are using there.

                    Looks like something is wrong with either definition of your taglib (custom one?) or the way you are using it.

                     

                    maybe you just need to open taglib definition and mark attribute as allowing expression.

                    • 7. Re: JSP in WildFly
                      t0920008899

                      Hello,

                       

                      Here are the possible error line in my jsp:

                      <title><c:out value="${logon.pagetitle}"/></title>

                       

                      I declared the line in the beginning of the jsp:

                      <%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>

                       

                      In the c.tld file:

                      <tag>

                         <name>out</name>

                         <tag-class>org.apache.taglibs.standard.tag.el.core.OutTag</tag-class>

                         <body-content>JSP</body-content>

                         <description>

                      Like &lt;%= ... &gt;, but for expressions.

                         </description>

                         <attribute>

                         <name>value</name>

                         <required>true</required>

                         <rtexprvalue>false</rtexprvalue>

                         </attribute>

                         <attribute>

                         <name>default</name>

                         <required>false</required>

                         <rtexprvalue>false</rtexprvalue>

                         </attribute>

                         <attribute>

                         <name>escapeXml</name>

                         <required>false</required>

                         <rtexprvalue>false</rtexprvalue>

                         </attribute>

                      </tag>

                       

                      Please kindly advise where went wrong.

                       

                      Best regards,

                      Joey

                      • 8. Re: JSP in WildFly
                        ctomc

                        standard taglib library is already part of server itself, so no need to have your own TLD definition for them.

                        i would suggest to delete the stuff your TLDs and just change definition on top to

                        <%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>

                         

                        and it should work just fine.

                         

                        if you want to keep your own taglibs, just set "rtexprvalue" attribute to true for value attribute.

                        but I would urge you to use server provided taglibs.

                         

                        also take a look at what taglib related jars you have in your WEB-INF/lib

                        • 9. Re: JSP in WildFly
                          t0920008899

                          Hello,

                           

                          The server provided lib worked, but my custom taglib still failed. I have defined a tag in the custom.tld:

                           

                          <tag>

                               <name>page</name>

                               <tag-class>com.softvanguard.tagext.PageTag</tag-class>

                               <body-content>JSP</body-content>

                               <attribute>

                                    <name>layout</name>

                                    <required>false</required>

                                    <rtexprvalue>true</rtexprvalue>

                               </attribute>

                          </tag>

                           

                          And in my jsp, I had:

                          <custom:page layout="${layout.objectname}">

                           

                          However, the issue is that, in my java implementation, the setLayout(layout) method was called with empty string. The same implementation worked well in JBoss EAP 6.4.0. I have no clues why. Please kindly advise.

                           

                          Best regards,

                          Joey