4 Replies Latest reply on Nov 27, 2017 7:51 AM by shekark

    Precompiled libraries for WildFly 9.0.1 Final

    ppantula83

      Hi All,

       

      We are migrating our application from Jboss7.1.1 to WildFly9.0.1 Final.

      We pre-compile all our jsp files and deploy the application.

      Though at the time of deployment in wildfly I did not see any issues. But while invoking the jsp file it is giving me following exception.

       

      I have used tomcat and jasper libraries to pre compile jsp files in my application.

      I created a module in WildFly and added this dependency in ear also. But still it is giving me this exception.

       

      Can anyone tell me what's going wrong ?

       

      16:55:45,906 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /app/household/pages/customer/CustomerLogin.jsp: java.lang.ClassCastException: org.wildfly.extension.undertow.deployment.UndertowJSPInstanceManager cannot be cast to org.apache.tomcat.InstanceManager

          at org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(InstanceManagerFactory.java:32)

          at org.apache.jasper.runtime.TagHandlerPool.init(TagHandlerPool.java:83)

          at org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(TagHandlerPool.java:63)

          at org.apache.jsp.pages.customer.CustomerLogin_jsp._jspInit(Unknown Source)

          at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)

          at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)

          at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)

          at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)

          at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)

          at io.undertow.servlet.core.ManagedServlet.getServlet(ManagedServlet.java:169)

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

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

          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:131)

          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:58)

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

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

          at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

          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 io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

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

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

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

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

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

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

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

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

       

      Thanks in Advance,

      Pradeep. P

        • 1. Re: Precompiled libraries for WildFly 9.0.1 Final
          jameslivingston

          You have pre-compiled them using something which assumes you are using Tomcat or something close enough like JBossWeb was. WildFly uses Undertow, so you can't use a Tomcat JSP pre-compiler to do it. As I just mentioned on your other thrad ANT task and libraries to precompile jsp files, I don't think you can safely pre-compile JSPs for EE6 or later.

          • 2. Re: Precompiled libraries for WildFly 9.0.1 Final
            ctomc

            Well, Undertow uses jastow as jsp compiler/container which is fork of jasper (tomcat's one).

             

            Jastow 2.x was rebased to upstream jastow over the summer and one of main benefits that got us was to be able to run precompiled JSPs that ware compiled with Tomcat's jsp compiler. as they are essentially the same.

             

            Jastow 2 is used by default in WildFly 10, so i would give that a try, there is also an option to use it in WildFly9 but you would need to rebuild server with it.

            • 3. Re: Precompiled libraries for WildFly 9.0.1 Final
              mmuthu

              I'm into similar situation with Wildfly 10.1. I pre-compiled my JSP using tomcat 9x libraries. I'm not able to get this running in Wildfly. Do you have any suggestion? Is it worth trying to find more options to precompile JSP's to run with Wildfly...? The exception that i get at runtime is

               

              Caused by: java.lang.NoSuchMethodError: org.apache.jasper.runtime.JspRuntimeLibrary.releaseTag(Ljavax/servlet/jsp/tagext/Tag;Lorg/apache/tomcat/InstanceManager;Z)V....

              • 4. Re: Precompiled libraries for WildFly 9.0.1 Final
                shekark

                We also ran into same problem in the process of migration of jboss-as-7.1.1.Final to wildfly-10.1.0.Final.

                 

                Did you got any solution?