8 Replies Latest reply on Aug 23, 2016 2:05 AM by armahdi

    HTTP method POST is not supported by this URL

    simas_ch

      Hi again,

       

      I'm still trying to port my application from JBoss 6 to WildFly.

       

      Now I have a problem with JSF.

      Suddenly when I click on a Link I got

      HTTP method POST is not supported by this URL

       

      What happens here?

       

      Thanks, Simon

        • 1. Re: HTTP method POST is not supported by this URL
          jaikiran

          What URL is that?

           

           

          Simon Martinelli wrote:

           

          Suddenly when I click on a Link I got

          Typically "links" are normal GET requests. So like I asked, you'll have to tell us more about what the URL/link is.

          • 2. Re: HTTP method POST is not supported by this URL
            ssilvert

            Sounds like your URL doesn't map to the FacesServlet, which certainly does support POST!

             

            Without more information, there is no way to tell for sure what is happening.  What is the URL being submitted?

             

            Stan

            • 3. Re: HTTP method POST is not supported by this URL
              simas_ch

              Oh I'm sorry that I was not precise enough:

               

              The problems is on normal JSF commandLink.

              Some times it works and then suddenly I show this problem. Without any log entry!

               

              But now I have an exception after clicking around a while:

               

              15:47:48,261 ERROR [io.undertow.request] (default task-11) Servlet request failed io.undertow.server.HttpServerExchange@1d235ac: java.lang.NullPointerException

                        at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:485) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:73) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:619) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:116) [jboss-jsf-api_2.2_spec-2.2.0-m13.jar:2.2.0-m13]

                        at org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.java:133) [primefaces-3.5.jar:]

                        at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:199) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:124) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:100) [jboss-jsf-api_2.2_spec-2.2.0-m13.jar:2.2.0-m13]

                        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:121) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.0-m13-jbossorg-1.jar:]

                        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) [jboss-jsf-api_2.2_spec-2.2.0-m13.jar:2.2.0-m13]

                        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:138) [undertow-websockets-jsr-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at com.prodega.proshop.web.filter.SecurityFilter.doFilter(SecurityFilter.java:31) [classes:]

                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at com.prodega.proshop.web.filter.EncodingFilter.doFilter(EncodingFilter.java:19) [classes:]

                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79) [primefaces-3.5.jar:]

                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at com.prodega.proshop.web.filter.ErrorFilter.doFilter(ErrorFilter.java:25) [classes:]

                        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:82) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:116) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

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

                        at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:52) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:66) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:71) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:26) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at org.wildfly.extension.undertow.security.SecurityContextCreationHandler.handleRequest(SecurityContextCreationHandler.java:56)

                        at io.undertow.server.HttpHandlers.executeHandler(HttpHandlers.java:46) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:26) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:118) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:106) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:83) [undertow-servlet-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpHandlers.executeRootHandler(HttpHandlers.java:52) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:544) [undertow-core-1.0.0.Alpha15.jar:1.0.0.Alpha15]

                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

                        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

               

              Btw. This application runs on JBoss 6 without any problems.

              • 4. Re: HTTP method POST is not supported by this URL
                emsouza

                I have the same problem with WildFly 8.1.0 and Undertow 1.0.15.Final.

                 

                I'm trying to access a page with post and get the same error "HTTP method POST is not supported by this URL" on browser.

                 

                My url is: "https://127.0.0.1:8443/teste/teste.html?locale=pt_BR#moduleteste"

                 

                The server does not print any error.

                • 5. Re: HTTP method POST is not supported by this URL
                  immobilia

                  Hi, like Eduardo, under WildFly/10 with Undertow 1.3.15,

                  OK when i access to a static xml file under my WebContent with GET method

                  KO when i access to a static xml file under my WebContent with POST method : HTTP Status 405 and html content is : "HTTP method POST is not supported by this URL"

                  Is there a way to allow serving static files with POST method ?

                  • 6. Re: HTTP method POST is not supported by this URL
                    swd847

                    I think the only way to do this at the moment is to map a filter to the default servlet that wraps the request and changes the method to GET

                    • 7. Re: HTTP method POST is not supported by this URL
                      immobilia

                      Thank yiu Stuart Douglas, is working fine now !

                      • 8. Re: HTTP method POST is not supported by this URL
                        armahdi

                        hello Stuart,

                        i had the same question. i posted it today on https://developer.jboss.org/thread/272005

                        how do we do that what you are proposing. "to map a filter to the default servlet that wraps the request and changes the method to GET "