4 Replies Latest reply on Apr 11, 2018 7:57 AM by priya baskar

    Struts 2 deployment failing in JBOSS 7.x

    priya baskar Newbie

      Hi all,

       

          I am unable to deploy my struts web application in JBOSS 7.x when migrating from JBOSS 5.x.

       

          It is working fine in JBOSS 5.x and apache tomcat 6.x.

       

          When migrating to JBOSS 7.x am getting the following error

       

           Reponse already committed error

        • 1. Re: Struts 2 deployment failing in JBOSS 7.x
          Anup Dey Expert

          Can you paste the error stack trace excerpt of "Reponse already committed error" from log file ?

          • 2. Re: Struts 2 deployment failing in JBOSS 7.x
            priya baskar Newbie

            15:47:55,910 ERROR [io.undertow.request] (default task-12) UT005023: Exception handling request to /WEBPORTAL/exception.jsp: javax.servlet.ServletException: java.lang.RuntimeException: java.lang.IllegalStateException: UT010019: Response already commited

            at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) [struts2-core-2.0.11.jar:]

            at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) [struts2-core-2.0.11.jar:]

            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

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

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            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.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.Connectors.executeRootHandler(Connectors.java:207) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:802) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]

            at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

            Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: UT010019: Response already commited

            at io.undertow.servlet.spec.RequestDispatcherImpl.includeImpl(RequestDispatcherImpl.java:358) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.spec.RequestDispatcherImpl.include(RequestDispatcherImpl.java:265) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:141) [struts2-core-2.0.11.jar:]

            at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) [struts2-core-2.0.11.jar:]

            at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) [xwork-2.0.4.jar:]

            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) [xwork-2.0.4.jar:]

            at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) [struts2-core-2.0.11.jar:]

            at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) [struts2-core-2.0.11.jar:]

            ... 30 more

            Caused by: java.lang.IllegalStateException: UT010019: Response already commited

            at io.undertow.servlet.spec.HttpServletResponseImpl.sendRedirect(HttpServletResponseImpl.java:181) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at org.apache.jsp.exception_jsp._jspService(exception_jsp.java:100)

            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jastow-2.0.0.Final-redhat-1.jar:2.0.0.Final-redhat-1]

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]

            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) [jastow-2.0.0.Final-redhat-1.jar:2.0.0.Final-redhat-1]

            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402) [jastow-2.0.0.Final-redhat-1.jar:2.0.0.Final-redhat-1]

            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346) [jastow-2.0.0.Final-redhat-1.jar:2.0.0.Final-redhat-1]

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:81) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32) [jastow-2.0.0.Final-redhat-1.jar:2.0.0.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:266) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToServlet(ServletInitialHandler.java:211) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            at io.undertow.servlet.spec.RequestDispatcherImpl.includeImpl(RequestDispatcherImpl.java:352) [undertow-servlet-1.3.25.Final-redhat-1.jar:1.3.25.Final-redhat-1]

            ... 37 more

            • 3. Re: Struts 2 deployment failing in JBOSS 7.x
              Anup Dey Expert

              The response has been committed already, and a redirect cannot be sent for an already committed response. As noted in Servlet API doc, IllegalStateException will be thrown in this scenario.

               

              Note that a response will be committed under the following conditions:

               

              - HttpServletResponse.flushBuffer() already has been called

              - HttpServletResponse.sendError() already has been called

              - HttpServletResponse.sendRedirect() already has been called

              - out.flush() has been called in JSP

              - <jsp:include> is used with flush="true" (like <jsp:include page="xxx.jsp" flush="true" />) in JSP

               

              1.You have to Identify what is committing or redirecting the request unexpectedly..

              2.You need to increase the buffer size via ServletResponse.setBufferSize(int size)

              3.The problem may be with dependencies - servlet.jar