2 Replies Latest reply on Mar 30, 2015 6:57 PM by Christian Sadilek

    Error when trying to use (and not) WebSockets in Wildfly 8.1.0 and Wildfly 8.20

    Anton Hughes Master

      Hi csa, werrenmi

       

      I am trying to get Websockets working with Errai 3.1.2.Final

       

      I have managed to deploy into Wildfly 8.2.0 Final, and set the following in the Errai Properties file:

       

      errai.bus.enable_web_socket_server=true
      errai.require_authentication_for_all=false
      
      
      
      
      
      
      
      
      
      

       

      I have added the following to my web.xml:

       

      <context-param>
          <param-name>websockets-enabled</param-name>
          <param-value>true</param-value>
          </context-param>
          <context-param>
          <param-name>force-secure-websockets</param-name>
          <param-value>false</param-value>
          </context-param>
      
      
      
      
      
      
      
      
      

       

      But in Chrome I see the following:

       

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM8189:2 POST http://localhost:8081/in.15909-9381.erraiBus?z=0&clientId=15909-9381&wait=1 401 (Unauthorized)

      VM8189:2 POST http://localhost:8081/out.15909-9381.erraiBus?z=418&clientId=15909-9381 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM8189:2 POST http://localhost:8081/out.15909-9381.erraiBus?z=421&clientId=15909-9381 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM8189:2 POST http://localhost:8081/in.15909-9381.erraiBus?z=0&clientId=15909-9381&wait=1 401 (Unauthorized)

      VM8189:2 POST http://localhost:8081/out.15909-9381.erraiBus?z=423&clientId=15909-9381 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM8189:2 POST http://localhost:8081/out.15909-9381.erraiBus?z=426&clientId=15909-9381 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM8189:2 POST http://localhost:8081/in.15909-9381.erraiBus?z=0&clientId=15909-9381&wait=1 401 (Unauthorized)

      VM8189:2 POST http://localhost:8081/out.15909-9381.erraiBus?z=428&clientId=15909-9381 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM8189:2 POST http://localhost:8081/out.15909-9381.erraiBus?z=431&clientId=15909-9381 401 (Unauthorized)


      And in the server log I see:


      2015-03-26 14:09:02,933 ERROR [io.undertow.request] (default task-77) UT005023: Exception handling request to /in.erraiBusWS: javax.servlet.ServletException: Filtered request failed.

        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:384) [shiro-web-1.2.2.jar:1.2.2]

      at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.2.2.jar:1.2.2]

      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

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

      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

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

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

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

      at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

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

      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.1.0.Final.jar:1.1.0.Final]

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

      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

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

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

      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]

      Caused by: java.lang.NullPointerException

      at org.jboss.errai.bus.server.websocket.jsr356.configuration.ErraiEndpointConfigurator.applyWebsocketFilters(ErraiEndpointConfigurator.java:46) [errai-bus-jsr356-websocket-3.1.2.Final.jar:3.1.2.Final]

      at org.jboss.errai.bus.server.websocket.jsr356.configuration.ErraiEndpointConfigurator.modifyHandshake(ErraiEndpointConfigurator.java:30) [errai-bus-jsr356-websocket-3.1.2.Final.jar:3.1.2.Final]

      at io.undertow.websockets.jsr.handshake.HandshakeUtil.prepareUpgrade(HandshakeUtil.java:63) [undertow-websockets-jsr-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.websockets.jsr.handshake.JsrHybi13Handshake.upgradeChannel(JsrHybi13Handshake.java:51) [undertow-websockets-jsr-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.websockets.core.protocol.Handshake.performUpgrade(Handshake.java:120) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.websockets.core.protocol.Handshake.performUpgrade(Handshake.java:148) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.websockets.core.protocol.version13.Hybi13Handshake.handshakeInternal(Hybi13Handshake.java:64) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.websockets.core.protocol.Handshake.handshake(Handshake.java:98) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:124) [undertow-websockets-jsr-1.1.0.Final.jar:1.1.0.Final]

      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

       

       

      Any ideas on how to fix this?

       

      Thanks

       

      Update


      Seeing as Websockets is not working, I try to turn it off using:

       

      errai.require_authentication_for_all=false#
      # (Optional) A Login MOTD sendNowWith be sent sendNowWith the client upon successful login.
      #
      errai.login_motd=UNAUTHORIZED ACCESS IS PROHIBITED!
      errai.bus.enable_web_socket_server=false
      
      
      
      

       

      and get the following in Chrome:

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=129&clientId=67986-20825 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/in.67986-20825.erraiBus?z=0&clientId=67986-20825&wait=1 401 (Unauthorized)

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=131&clientId=67986-20825 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=133&clientId=67986-20825 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=135&clientId=67986-20825 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=137&clientId=67986-20825 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=139&clientId=67986-20825 401 (Unauthorized)

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:7823 WebSocket connection to 'ws://localhost:8081/in.erraiBusWS' failed: Error during WebSocket handshake: Unexpected response code: 500

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      B9CEDF8A80B32B48F463264B6AB477B5.cache.html:2889 Uncaught TypeError: Cannot read property 'close' of undefined

      VM1302:2 POST http://localhost:8081/out.67986-20825.erraiBus?z=141&clientId=67986-20825 401 (Unauthorized)

       

       

      And this in Wildfly logs:

       

      2015-03-26 19:28:46,572 ERROR [io.undertow.request] (default task-109) UT005023: Exception handling request to /in.erraiBusWS: javax.servlet.ServletException: Filtered request failed.

        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:384) [shiro-web-1.2.2.jar:1.2.2]

        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.2.2.jar:1.2.2]

        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

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

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

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

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

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

        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

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

        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.1.0.Final.jar:1.1.0.Final]

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

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

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

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

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]

      Caused by: java.lang.NullPointerException

        at org.jboss.errai.bus.server.websocket.jsr356.configuration.ErraiEndpointConfigurator.applyWebsocketFilters(ErraiEndpointConfigurator.java:46) [errai-bus-jsr356-websocket-3.1.2.Final.jar:3.1.2.Final]

        at org.jboss.errai.bus.server.websocket.jsr356.configuration.ErraiEndpointConfigurator.modifyHandshake(ErraiEndpointConfigurator.java:30) [errai-bus-jsr356-websocket-3.1.2.Final.jar:3.1.2.Final]

        at io.undertow.websockets.jsr.handshake.HandshakeUtil.prepareUpgrade(HandshakeUtil.java:63) [undertow-websockets-jsr-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.websockets.jsr.handshake.JsrHybi13Handshake.upgradeChannel(JsrHybi13Handshake.java:51) [undertow-websockets-jsr-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.websockets.core.protocol.Handshake.performUpgrade(Handshake.java:120) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.websockets.core.protocol.Handshake.performUpgrade(Handshake.java:148) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.websockets.core.protocol.version13.Hybi13Handshake.handshakeInternal(Hybi13Handshake.java:64) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.websockets.core.protocol.Handshake.handshake(Handshake.java:98) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:124) [undertow-websockets-jsr-1.1.0.Final.jar:1.1.0.Final]

        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

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

        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.2.2.jar:1.2.2]

        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.2.2.jar:1.2.2]

        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.2.2.jar:1.2.2]

        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.2.2.jar:1.2.2]

        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) [shiro-core-1.2.2.jar:1.2.2]

        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.2.2.jar:1.2.2]

        ... 29 more

       

      Update 2

      I have tried using Wildfly 8.1.0, with websocket turned off, and am getting the same results.

        • 1. Re: Error when trying to use WebSockets
          Anton Hughes Master

          I have tried using Errai 3.2.0-SNAPSHOT, and with this version I get the following error:

           

          2015-03-26 15:47:58,476 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-16) MSC000001: Failed to start service jboss.deployment.unit."app.ui.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.ui.war".WeldStartService: Failed to start service

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

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

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

            at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]

          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type CdiFilterLookup with qualifiers @Default

            at injection point [BackedAnnotatedField] @Inject private org.jboss.errai.bus.server.websocket.jsr356.weld.CdiDelegationListener.cdiFilterLookup

            at org.jboss.errai.bus.server.websocket.jsr356.weld.CdiDelegationListener.cdiFilterLookup(CdiDelegationListener.java:0)

            Possible dependencies:

            - Managed Bean [class org.jboss.errai.bus.server.websocket.jsr356.weld.filter.CdiFilterLookup] with qualifiers [@Any @Default],

            - Managed Bean [class org.jboss.errai.bus.server.websocket.jsr356.weld.filter.CdiFilterLookup] with qualifiers [@Any @Default]

           

           

            at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:380)

            at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:293)

            at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)

            at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:167)

            at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:531)

            at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)

            at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)

            at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)

            at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)

            at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_75]

            ... 3 more

           

           

          2015-03-26 15:47:58,537 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) JBAS014613: Operation ("redeploy") failed - address: ([("deployment" => "app.ui.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"app.ui.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"app.ui.war\".WeldStartService: Failed to start service

              Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type CdiFilterLookup with qualifiers @Default

            at injection point [BackedAnnotatedField] @Inject private org.jboss.errai.bus.server.websocket.jsr356.weld.CdiDelegationListener.cdiFilterLookup

            at org.jboss.errai.bus.server.websocket.jsr356.weld.CdiDelegationListener.cdiFilterLookup(CdiDelegationListener.java:0)

            Possible dependencies:

            - Managed Bean [class org.jboss.errai.bus.server.websocket.jsr356.weld.filter.CdiFilterLookup] with qualifiers [@Any @Default],

            - Managed Bean [class org.jboss.errai.bus.server.websocket.jsr356.weld.filter.CdiFilterLookup] with qualifiers [@Any @Default]

          "}}

          2015-03-26 15:47:58,541 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015860: Redeploy of deployment "app.ui.war" was rolled back with the following failure message:

          {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"app.ui.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"app.ui.war\".WeldStartService: Failed to start service

              Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type CdiFilterLookup with qualifiers @Default

            at injection point [BackedAnnotatedField] @Inject private org.jboss.errai.bus.server.websocket.jsr356.weld.CdiDelegationListener.cdiFilterLookup

            at org.jboss.errai.bus.server.websocket.jsr356.weld.CdiDelegationListener.cdiFilterLookup(CdiDelegationListener.java:0)

            Possible dependencies:

            - Managed Bean [class org.jboss.errai.bus.server.websocket.jsr356.weld.filter.CdiFilterLookup] with qualifiers [@Any @Default],

            - Managed Bean [class org.jboss.errai.bus.server.websocket.jsr356.weld.filter.CdiFilterLookup] with qualifiers [@Any @Default]

          "}}

          • 2. Re: Error when trying to use (and not) WebSockets in Wildfly 8.1.0 and Wildfly 8.20
            Christian Sadilek Master

            Hi Anton,

             

            The first issue seems to be related to this: https://developer.jboss.org/thread/253617

             

            Looks like there's a servlet filter or interceptor (possibly provided by a security lib?) that's (mis)configured to trigger for Errai bus requests and causes a 401 (unauthorized) response. This is why the bus doesn't start up properly.

             

            The second issue is that you somehow managed to deploy the errai-bus-jsr356-websocket-weld.jar twice.

             

            Cheers,

            Christian