5 Replies Latest reply on Jun 1, 2016 10:37 AM by stan_hg

    wildfly-10.0.0.Final LearningPushHandler

    stan_hg

      Hi,

       

      as i am trying to assess the performance using server push in http/2, having difficulties to setup LearningPushHandler.

       

      in standalone.xml, configuration is as follows:

       

      <subsystem xmlns="urn:jboss:domain:undertow:3.0">

                  <buffer-cache name="default"/>

                  <server name="default-server">

                      <http-listener name="default" socket-binding="http"/>

                      <https-listener name="default-https" security-realm="httpsRealm" socket-binding="https" enable-http2="true"/>

                      <host name="default-host" alias="localhost">

                          <location name="/" handler="welcome-content"/>                                     

        <filter-ref name="server-push" />

                      </host>

                  </server>

                  <servlet-container name="default">

                      <jsp-config/>

                      <websockets/>

                  </servlet-container>

                  <handlers>

                      <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>

                  </handlers>

                  <filters>

        <filter name="server-push" class-name="io.undertow.server.handlers.LearningPushHandler"  module="io.undertow.core">

        <param name="max-age" value="120"/>

        <param name="max-entries" value="1200"/>

           </filter>

                  </filters>

              </subsystem>

       

      and there is an error while accessing the web page:

       

      2016-05-26 13:42:20,390 ERROR [io.undertow.request] (default I/O-5) UT005071: Undertow request failed HttpServerExchange{ GET /bg;jsessionid=altr0DCUcqiOa3MdI68NhboMsfHlhWLf_TpSvVfq.stan-pc request {accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], accept-language=[bg-BG,bg;q=0.8,en;q=0.6], cache-control=[max-age=0], accept-encoding=[gzip, deflate, sdch], user-agent=[Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36], upgrade-insecure-requests=[1], Host=[localhost:8444]} response {}}: java.lang.RuntimeException: WFLYUT0064: Failed to configure handler class io.undertow.server.handlers.LearningPushHandler

        at org.wildfly.extension.undertow.deployment.ConfiguredHandlerWrapper.wrap(ConfiguredHandlerWrapper.java:78)

        at org.wildfly.extension.undertow.filters.CustomFilterDefinition.createHttpHandler(CustomFilterDefinition.java:100)

        at org.wildfly.extension.undertow.filters.FilterService.createHttpHandler(FilterService.java:57)

        at org.wildfly.extension.undertow.filters.FilterRef.createHttpHandler(FilterRef.java:69)

        at org.wildfly.extension.undertow.LocationService.configureHandlerChain(LocationService.java:96)

        at org.wildfly.extension.undertow.Host.configureRootHandler(Host.java:117)

        at org.wildfly.extension.undertow.Host.getOrCreateRootHandler(Host.java:171)

        at org.wildfly.extension.undertow.Host$HostRootHandler.handleRequest(Host.java:285)

        at io.undertow.server.handlers.NameVirtualHostHandler.handleRequest(NameVirtualHostHandler.java:54)

        at io.undertow.server.handlers.error.SimpleErrorPageHandler.handleRequest(SimpleErrorPageHandler.java:76)

        at io.undertow.server.handlers.CanonicalPathHandler.handleRequest(CanonicalPathHandler.java:49)

       

       

      what i am doing wrong?

       

       

      Thanks

        • 1. Re: wildfly-10.0.0.Final LearningPushHandler
          jaikiran

          2016-05-26 13:42:20,390 ERROR [io.undertow.request] (default I/O-5) UT005071: Undertow request failed HttpServerExchange{ GET /bg;jsessionid=altr0DCUcqiOa3MdI68NhboMsfHlhWLf_TpSvVfq.stan-pc request {accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], accept-language=[bg-BG,bg;q=0.8,en;q=0.6], cache-control=[max-age=0], accept-encoding=[gzip, deflate, sdch], user-agent=[Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36], upgrade-insecure-requests=[1], Host=[localhost:8444]} response {}}: java.lang.RuntimeException: WFLYUT0064: Failed to configure handler class io.undertow.server.handlers.LearningPushHandler

            at org.wildfly.extension.undertow.deployment.ConfiguredHandlerWrapper.wrap(ConfiguredHandlerWrapper.java:78)

            at org.wildfly.extension.undertow.filters.CustomFilterDefinition.createHttpHandler(CustomFilterDefinition.java:100)

            at org.wildfly.extension.undertow.filters.FilterService.createHttpHandler(FilterService.java:57)

            at org.wildfly.extension.undertow.filters.FilterRef.createHttpHandler(FilterRef.java:69)

            at org.wildfly.extension.undertow.LocationService.configureHandlerChain(LocationService.java:96)

            at org.wildfly.extension.undertow.Host.configureRootHandler(Host.java:117)

            at org.wildfly.extension.undertow.Host.getOrCreateRootHandler(Host.java:171)

            at org.wildfly.extension.undertow.Host$HostRootHandler.handleRequest(Host.java:285)

            at io.undertow.server.handlers.NameVirtualHostHandler.handleRequest(NameVirtualHostHandler.java:54)

            at io.undertow.server.handlers.error.SimpleErrorPageHandler.handleRequest(SimpleErrorPageHandler.java:76)

            at io.undertow.server.handlers.CanonicalPathHandler.handleRequest(CanonicalPathHandler.java:49)

           

           

          what i am doing wrong?

           

           

          Thanks

           

          Please post the entire exception stacktrace. I one you posted looks just a partial stacktrace.

          • 2. Re: wildfly-10.0.0.Final LearningPushHandler
            stan_hg

            Yes, sorry for that

             

             

            2016-05-26 13:42:20,390 ERROR [io.undertow.request] (default I/O-5) UT005071: Undertow request failed HttpServerExchange{ GET /bg;jsessionid=altr0DCUcqiOa3MdI68NhboMsfHlhWLf_TpSvVfq.stan-pc request {accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], accept-language=[bg-BG,bg;q=0.8,en;q=0.6], cache-control=[max-age=0], accept-encoding=[gzip, deflate, sdch], user-agent=[Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36], cookie=[GLog=%7B%0D%20%20%20%20left%3A850%2C%20%0D%20%20%20%20top%3A62%2C%20%0D%20%20%20%20width%3A1039%2C%20%0D%20%20%20%20height%3A936%2C%20%0D%20%20%20%20priorityDefaults%3A%7B%0D%20%20%20%20%20%20%20%20sgwtInternal%3A1%2C%20%0D%20%20%20%20%20%20%20%20Log%3A4%0D%20%20%20%20%7D%2C%20%0D%20%20%20%20defaultPriority%3A3%2C%20%0D%20%20%20%20trackRPC%3Atrue%2C%20%0D%20%20%20%20pageGUID%3A%225923E323-B473-40D6-A317-9A08159D2185%22%0D%7D, username=/c0421/c0421/c0422/c0410/c041D/c0415/c0412/c0410, cookie_acceptcookies=true, __utma=111872281.24980792.1454663703.1458038077.1458038077.1, __utmz=111872281.1458038077.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none), JSESSIONID=altr0DCUcqiOa3MdI68NhboMsfHlhWLf_TpSvVfq.stan-pc, _ga=GA1.1.24980792.1454663703], upgrade-insecure-requests=[1], Host=[localhost:8444]} response {}}: java.lang.RuntimeException: WFLYUT0064: Failed to configure handler class io.undertow.server.handlers.LearningPushHandler

              at org.wildfly.extension.undertow.deployment.ConfiguredHandlerWrapper.wrap(ConfiguredHandlerWrapper.java:78)

              at org.wildfly.extension.undertow.filters.CustomFilterDefinition.createHttpHandler(CustomFilterDefinition.java:100)

              at org.wildfly.extension.undertow.filters.FilterService.createHttpHandler(FilterService.java:57)

              at org.wildfly.extension.undertow.filters.FilterRef.createHttpHandler(FilterRef.java:69)

              at org.wildfly.extension.undertow.LocationService.configureHandlerChain(LocationService.java:96)

              at org.wildfly.extension.undertow.Host.configureRootHandler(Host.java:117)

              at org.wildfly.extension.undertow.Host.getOrCreateRootHandler(Host.java:171)

              at org.wildfly.extension.undertow.Host$HostRootHandler.handleRequest(Host.java:285)

              at io.undertow.server.handlers.NameVirtualHostHandler.handleRequest(NameVirtualHostHandler.java:54)

              at io.undertow.server.handlers.error.SimpleErrorPageHandler.handleRequest(SimpleErrorPageHandler.java:76)

              at io.undertow.server.handlers.CanonicalPathHandler.handleRequest(CanonicalPathHandler.java:49)

              at io.undertow.server.handlers.ChannelUpgradeHandler.handleRequest(ChannelUpgradeHandler.java:158)

              at io.undertow.server.protocol.http2.Http2UpgradeHandler.handleRequest(Http2UpgradeHandler.java:95)

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

              at io.undertow.server.protocol.http2.Http2ReceiveListener.handleRequests(Http2ReceiveListener.java:179)

              at io.undertow.server.protocol.http2.Http2ReceiveListener.handleEvent(Http2ReceiveListener.java:109)

              at io.undertow.server.protocol.http2.Http2ReceiveListener.handleEvent(Http2ReceiveListener.java:56)

              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)

              at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:872)

              at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:853)

              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)

              at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)

              at io.undertow.protocols.ssl.SslConduit$SslReadReadyHandler.readReady(SslConduit.java:1059)

              at io.undertow.protocols.ssl.SslConduit$1.run(SslConduit.java:229)

              at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:580)

              at org.xnio.nio.WorkerThread.run(WorkerThread.java:464)

            Caused by: java.lang.NoSuchMethodException: io.undertow.server.handlers.LearningPushHandler.<init>(io.undertow.server.HttpHandler)

              at java.lang.Class.getConstructor0(Class.java:3082)

              at java.lang.Class.getConstructor(Class.java:1825)

              at org.wildfly.extension.undertow.deployment.ConfiguredHandlerWrapper.wrap(ConfiguredHandlerWrapper.java:55)

              ... 25 more

            • 3. Re: wildfly-10.0.0.Final LearningPushHandler
              jaikiran

              Stan Golemanov wrote:

               

              Yes, sorry for that

               

               

              Caused by: java.lang.NoSuchMethodException: io.undertow.server.handlers.LearningPushHandler.<init>(io.undertow.server.HttpHandler)

                at java.lang.Class.getConstructor0(Class.java:3082)

                at java.lang.Class.getConstructor(Class.java:1825)

                at org.wildfly.extension.undertow.deployment.ConfiguredHandlerWrapper.wrap(ConfiguredHandlerWrapper.java:55)

                ... 25 more

              In its current form, it doesn't look like you can use that filter in the WildFly undertow subsystem's filters. I have submitted a PR to undertow project Add a convenience constructor to LearningPushHandler by jaikiran · Pull Request #405 · undertow-io/undertow · GitHub to allow this to work. If it gets accepted, you should be able to configure it in WildFly, in an upcoming release.

              • 4. Re: wildfly-10.0.0.Final LearningPushHandler
                ctomc

                you could use expression-handler to configure this instead of custom-handler

                 

                something like

                 

                <expression-filter name="learning-push" expression="learning-push" />

                • 5. Re: wildfly-10.0.0.Final LearningPushHandler
                  stan_hg

                  @ jaikiran pai : thanks

                   

                  @ Tomaz Cerar: tried as you suggested, there was no error, but i am not sure of the result as i did not saw any server push in F12 network console