Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-7539

WebSocketTestCase fails with security manager - disable test

XMLWordPrintable

      With the core 3.0.0.Alpha12 upgrade we see failures in the WebSocketTestCase when run with the security manager enabled.

      $mvn clean install -pl testsuite/integration/web/ -Dsecurity.manager=true

      For now I am adding a

      Assume.assumeTrue(System.getSecurityManager() == null);
      

      to skip this test when running with a security manager enabled. The failure when the test is run with a security manager is

      testWebSocket(org.jboss.as.test.integration.web.websocket.WebSocketTestCase)  Time elapsed: 0.227 sec  <<< ERROR!
      java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.net.SocketPermission" "localhost:0" "listen,resolve")" in code source "(vfs:/content/websocket.war/WEB-INF/classes <no signer certificates>)" of "ModuleClassLoader for Module "deployment.websocket.war:main" from Service Module Loader")
        at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:278)
        at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175)
        at java.lang.SecurityManager.checkListen(SecurityManager.java:1131)
        at org.wildfly.security.manager.WildFlySecurityManager.checkListen(WildFlySecurityManager.java:392)
        at sun.nio.ch.SocketChannelImpl.bind(SocketChannelImpl.java:582)
        at sun.nio.ch.SocketAdaptor.bind(SocketAdaptor.java:135)
        at org.xnio.nio.WorkerThread.openTcpStreamConnection(WorkerThread.java:263)
        at org.xnio.XnioIoThread.openStreamConnection(XnioIoThread.java:237)
        at org.xnio.XnioWorker.openStreamConnection(XnioWorker.java:342)
        at org.xnio.http.HttpUpgrade$HttpUpgradeState.doUpgrade(HttpUpgrade.java:247)
        at org.xnio.http.HttpUpgrade$HttpUpgradeState.access$100(HttpUpgrade.java:165)
        at org.xnio.http.HttpUpgrade.performUpgrade(HttpUpgrade.java:129)
        at io.undertow.websockets.client.WebSocketClient$ConnectionBuilder.connectImpl(WebSocketClient.java:323)
        at io.undertow.websockets.client.WebSocketClient$ConnectionBuilder.connect(WebSocketClient.java:211)
        at io.undertow.websockets.jsr.ServerWebSocketContainer.connectToServerInternal(ServerWebSocketContainer.java:463)
        at io.undertow.websockets.jsr.ServerWebSocketContainer.connectToServerInternal(ServerWebSocketContainer.java:457)
        at io.undertow.websockets.jsr.ServerWebSocketContainer.connectToServer(ServerWebSocketContainer.java:211)
        at org.jboss.as.test.integration.web.websocket.WebSocketTestCase.testWebSocket(WebSocketTestCase.java:52)
      

              darran.lofthouse@redhat.com Darran Lofthouse
              kkhan1@redhat.com Kabir Khan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: