5 Replies Latest reply on Oct 31, 2013 8:40 AM by Wolf-Dieter Fink

    Wildfly ejb remote access with jaas

    bomc Newbie

      Hello

       

      i have simple standalone client that should invoking a remote ejb on wildfly beta1. On jboss 7.2.0 Final the client works as expected.

       

      The client code:

       

      public class RemoteEJBTest {

       

        private static final String USERNAME = "username";

        private static final String PASSWORD = "password";

       

        private static final String APP_NAME = "de-bomc-ear";

        private static final String MODUL_NAME = "de-bomc-ejb";

        private static final String DISTINCT_NAME = "";

       

        @Test

        public void test01_invokeRemoteEJBWithJAAS() throws Exception {

        RemoteBomcBoundaryEJB remoteBomcBoundaryEJB = lookupRemoteBomcBoundary();

        int countOfRegisteredUsers = remoteBomcBoundaryEJB.countRegisteredUsers();

       

        assertTrue(countOfRegisteredUsers >= 4);

        }

       

        private RemoteBomcBoundaryEJB lookupRemoteBomcBoundary() throws NamingException {

        Properties clientProp = new Properties();

       

        clientProp.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");

        clientProp.put("remote.connections", "default");

        clientProp.put("remote.connection.default.port", "8080");

        clientProp.put("remote.connection.default.host", "localhost");

        clientProp.put("remote.connection.default.username", RemoteEJBTest.USERNAME);

        clientProp.put("remote.connection.default.password", RemoteEJBTest.PASSWORD);

       

        clientProp.put("org.jboss.ejb.client.scoped.context","true");

       

        clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

        clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER");

        clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");

             

        clientProp.put("jboss.naming.client.ejb.context", true);

       

        EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(clientProp);

        ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);

        EJBClientContext.setSelector(selector);

       

        Properties props = new Properties();

        props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

       

        final Context context = new InitialContext(props);

       

        final String appName = APP_NAME;

        final String moduleName = MODUL_NAME;

        final String distinctName = DISTINCT_NAME;

        final String beanName = BomcBoundaryEJB.class.getSimpleName();

        final String viewClassName = RemoteBomcBoundaryEJB.class.getName();

        // Let's do the lookup.

        String jndiName = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;

       

       

        return (RemoteBomcBoundaryEJB) context.lookup(jndiName);

        }

      }

       

      The changes to the 7.2 version are:

       

      adding property: clientProp.put("org.jboss.ejb.client.scoped.context","true");


      and change the port from 4447 to 8080.


      I got the following exception:


      [15:39:23,494]DEBUG     0[main] - RemoteEJBTest.init(RemoteEJBTest.java:49) - init

      [15:39:23,526]DEBUG    32[main] - PropertiesBasedEJBClientConfiguration.<clinit>(PropertiesBasedEJBClientConfiguration.java:60) - Logging Provider: org.jboss.logging.Log4jLoggerProvider

      [15:39:23,552]DEBUG    58[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - endpoint.create.options. has the following options {}

      [15:39:23,554]DEBUG    60[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - remote.connectionprovider.create.options. has the following options {org.xnio.Options.SSL_ENABLED=>false}

      [15:39:23,557]DEBUG    63[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - remote.connection.default.connect.options. has the following options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER],org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false}

      [15:39:23,560]DEBUG    66[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - remote.connection.default.channel.options. has the following options {}

      [15:39:23,561]DEBUG    67[main] - PropertiesBasedEJBClientConfiguration.parseConnectionConfigurations(PropertiesBasedEJBClientConfiguration.java:471) - Connection org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration$RemotingConnectionConfigurationImpl@2350ad83 successfully created for connection named default

      [15:39:23,561]DEBUG    67[main] - PropertiesBasedEJBClientConfiguration.parseClusterConfigurations(PropertiesBasedEJBClientConfiguration.java:290) - No clusters configured in properties

      [15:39:23,589]DEBUG    95[main] - EJBClientPropertiesLoader.loadEJBClientProperties(EJBClientPropertiesLoader.java:101) - Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@5c4aca27

      [15:39:23,626]DEBUG   132[main] - RemoteEJBTest.lookupRemoteBomcBoundary(RemoteEJBTest.java:144) - ejb:de-bomc-ear/de-bomc-ejb//BomcBoundaryEJB!de.bomc.server.boundary.RemoteBomcBoundaryEJB

      [15:39:23,675] INFO   181[main] - EJBClient.<clinit>(EJBClient.java:45) - JBoss EJB Client version 2.0.0.Beta3

      [15:39:23,703] INFO   209[main] - Xnio.<clinit>(Xnio.java:73) - XNIO Version 3.1.0.CR3

      [15:39:23,721] INFO   227[main] - NioXnio.<clinit>(NioXnio.java:51) - XNIO NIO Implementation Version 3.1.0.CR3

      [15:39:23,797] INFO   303[main] - EndpointImpl.<clinit>(EndpointImpl.java:70) - JBoss Remoting version 4.0.0.Beta1

      [15:39:23,852]DEBUG   358[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:425) - Started channel thread 'Remoting "config-based-ejb-client-endpoint" I/O-1', selector sun.nio.ch.WindowsSelectorImpl@5f55b990

      [15:39:29,046] WARN  5552[main] - ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:156) - Could not register a EJB receiver for connection to localhost:8080



      java.lang.RuntimeException: Operation failed with status WAITING

        at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)

        at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77)

        at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)

        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:147)

        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115)

        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)

        at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)

        at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)

        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:176)

        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)

        at com.sun.proxy.$Proxy6.countRegisteredUsers(Unknown Source)

        at de.bomc.test.auth.ejb.RemoteEJBTest.test01_invokeRemoteEJBWithJAAS(RemoteEJBTest.java:62)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      [15:39:29,055]DEBUG  5561[main] - ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:160) - Registered a reconnect handler in EJB client context org.jboss.ejb.client.EJBClientContext@3a16cef5 for remote://localhost:8080

      [15:39:29,055]DEBUG  5561[main] - ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:165) - Registered 0 remoting EJB receivers for EJB client context org.jboss.ejb.client.EJBClientContext@3a16cef5

       

       

      What is the problem, why cannot connect the client to jboss?

        • 1. Re: Wildfly ejb remote access with jaas
          jaikiran pai Master

          Are you sure the server is up and there are no firewall rules which are preventing the access?

           

          What does the following output from the client command prompt:

           

          telnet localhost 8080

          • 2. Re: Wildfly ejb remote access with jaas
            bomc Newbie

            Thanks for your answer. The applicationserver is running. I have a simple webpage running and the page is available on port 8080 too. The same code above works on the same machine with JBoss 7.2.0 Final.

            • 3. Re: Wildfly ejb remote access with jaas
              Wolf-Dieter Fink Master

              If you use an EJBSelector approach you should not set the properties

              jboss.naming.clinet.ejb.context => this is a remote-naming project property and not usable in this context.

              org.jboss.ejb.client.scoped.context => this is a property which can be used to pass all the properties to InitialContext

               

              The only difference to AS7 is to change the port 4447 => 8080.

              And you should be able to contact the IP:port from the client machine.

              • 4. Re: Wildfly ejb remote access with jaas
                bomc Newbie

                Thanks for your answer. You are right with the properties. I'm using the same code to invoke the remote ejb on a jboss 7.2.0 and it is working . if the code is invoking the remote ejb on the wildfly it fails. Is it possible to see the http-remote-connector is working? The port 8080 is available, a web application is running on this port and works as expected.

                 

                I tried it with different version

                     -> "XNIO Version 3.0.7.GA", "XNIO NIO Implementation Version 3.0.7.GA", "JBoss Remoting version 3.2.14.GA"  -> works on Jboss 7.2.0.

                     -> "XNIO version 3.1.0.Final", "XNIO NIO Implementation Version 3.1.0.Final", " JBoss Remoting version 4.0.0.Beta1" , "JBoss EJB Client version 2.0.0.Beta3" -> fails on JBoss 7.2.0.

                 

                so I have only changed the libraries.

                 

                The logging ouput:

                 

                [10:32:24,054]DEBUG     0[main] - RemoteEJBTest.init(RemoteEJBTest.java:48) - init

                [10:32:24,095]DEBUG    41[main] - PropertiesBasedEJBClientConfiguration.<clinit>(PropertiesBasedEJBClientConfiguration.java:60) - Logging Provider: org.jboss.logging.Log4jLoggerProvider

                [10:32:24,139]DEBUG    85[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - endpoint.create.options. has the following options {}

                [10:32:24,141]TRACE    87[main] - PropertiesBasedEJBClientConfiguration.mergeWithDefaults(PropertiesBasedEJBClientConfiguration.java:267) - Options {} have been merged with defaults {org.xnio.Options.THREAD_DAEMON=>true} to form {org.xnio.Options.THREAD_DAEMON=>true}

                [10:32:24,143]DEBUG    89[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - remote.connectionprovider.create.options. has the following options {org.xnio.Options.SSL_ENABLED=>false}

                [10:32:24,143]TRACE    89[main] - PropertiesBasedEJBClientConfiguration.mergeWithDefaults(PropertiesBasedEJBClientConfiguration.java:267) - Options {org.xnio.Options.SSL_ENABLED=>false} have been merged with defaults {} to form {org.xnio.Options.SSL_ENABLED=>false}

                [10:32:24,146]DEBUG    92[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - remote.connection.default.connect.options. has the following options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER]}

                [10:32:24,147]TRACE    93[main] - PropertiesBasedEJBClientConfiguration.mergeWithDefaults(PropertiesBasedEJBClientConfiguration.java:267) - Options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER]} have been merged with defaults {} to form {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER]}

                [10:32:24,150]DEBUG    96[main] - PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:237) - remote.connection.default.channel.options. has the following options {}

                [10:32:24,152]DEBUG    98[main] - PropertiesBasedEJBClientConfiguration.parseConnectionConfigurations(PropertiesBasedEJBClientConfiguration.java:471) - Connection org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration$RemotingConnectionConfigurationImpl@3f0e92fe successfully created for connection named default

                [10:32:24,152]DEBUG    98[main] - PropertiesBasedEJBClientConfiguration.parseClusterConfigurations(PropertiesBasedEJBClientConfiguration.java:290) - No clusters configured in properties

                [10:32:24,190]DEBUG   136[main] - EJBClientPropertiesLoader.loadEJBClientProperties(EJBClientPropertiesLoader.java:101) - Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@dbe996d

                [10:32:24,235]DEBUG   181[main] - RemoteEJBTest.lookupRemoteBomcBoundary(RemoteEJBTest.java:142) - ejb:de-bomc-ear/de-bomc-ejb//BomcBoundaryEJB!de.bomc.server.boundary.RemoteBomcBoundaryEJB

                [10:32:24,290] INFO   236[main] - EJBClient.<clinit>(EJBClient.java:45) - JBoss EJB Client version 2.0.0.Beta3

                [10:32:24,347] INFO   293[main] - Xnio.<clinit>(Xnio.java:75) - XNIO version 3.1.0.Final

                [10:32:24,381] INFO   327[main] - NioXnio.<clinit>(NioXnio.java:52) - XNIO NIO Implementation Version 3.1.0.Final

                [10:32:24,441]TRACE   387[main] - NioXnio$2.run(NioXnio.java:143) - Starting up with selector provider class sun.nio.ch.WindowsSelectorProvider

                [10:32:24,444]TRACE   390[main] - NioXnio.<init>(NioXnio.java:186) - Using Default system selector creator for provider class sun.nio.ch.WindowsSelectorProvider for main selectors and Default system selector creator for provider class sun.nio.ch.WindowsSelectorProvider for temp selectors

                [10:32:24,500] INFO   446[main] - EndpointImpl.<clinit>(EndpointImpl.java:70) - JBoss Remoting version 4.0.0.Beta1

                [10:32:24,545]TRACE   491[main] - NioXnioWorker.openResourceUnconditionally(NioXnioWorker.java:191) - CAS org.xnio.nio.NioXnioWorker@143d2a58 00000001 -> 00000002

                [10:32:24,549]TRACE   495[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:421) - Starting worker thread Thread[Remoting "config-based-ejb-client-endpoint" I/O-1,5,main]

                [10:32:24,549]DEBUG   495[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:425) - Started channel thread 'Remoting "config-based-ejb-client-endpoint" I/O-1', selector sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:24,550]TRACE   496[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:24,555]TRACE   501[main] - EndpointImpl.<init>(EndpointImpl.java:132) - Completed open of endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:24,557]TRACE   503[main] - EndpointImpl.resourceUntick(EndpointImpl.java:186) - Allocated tick to 1 of endpoint "config-based-ejb-client-endpoint" <11498436> (opened Connection provider for remote)

                [10:32:24,632]TRACE   578[main] - EndpointImpl.addConnectionProvider(EndpointImpl.java:424) - Adding connection provider registration named 'remote': Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:24,638]TRACE   584[main] - EndpointImpl.resourceUntick(EndpointImpl.java:186) - Allocated tick to 2 of endpoint "config-based-ejb-client-endpoint" <11498436> (opened Connection provider for http-remoting)

                [10:32:24,643]TRACE   589[main] - EndpointImpl.addConnectionProvider(EndpointImpl.java:424) - Adding connection provider registration named 'http-remoting': Remoting remote connection provider 2d724ca6 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:24,644]TRACE   590[main] - EndpointImpl.resourceUntick(EndpointImpl.java:186) - Allocated tick to 3 of endpoint "config-based-ejb-client-endpoint" <11498436> (opened Connection provider for https-remoting)

                [10:32:24,644]TRACE   590[main] - EndpointImpl.addConnectionProvider(EndpointImpl.java:424) - Adding connection provider registration named 'https-remoting': Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:24,650]TRACE   596[main] - EndpointImpl.resourceUntick(EndpointImpl.java:186) - Allocated tick to 4 of endpoint "config-based-ejb-client-endpoint" <11498436> (opened Connection to /192.168.2.10:4447)

                [10:32:24,669]TRACE   615[main] - RemoteConnectionProvider.connect(RemoteConnectionProvider.java:145) - Attempting to connect to "/192.168.2.10:4447" with options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER]}

                [10:32:24,721]TRACE   667[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:24,722]TRACE   668[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.safeRun(WorkerThread.java:548) - Running task org.xnio.nio.WorkerThread$SynchTask@2c761b38

                [10:32:24,722]TRACE   668[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:24,764]TRACE   710[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:24,765]TRACE   711[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:25,757]TRACE  1703[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:25,758]TRACE  1704[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:523) - Selected key sun.nio.ch.SelectionKeyImpl@36471861 for java.nio.channels.SocketChannel[connection-pending local=/0:0:0:0:0:0:0:0:61984 remote=chabomc0-PC/192.168.2.150:4447]

                [10:32:25,760]TRACE  1706[Remoting "config-based-ejb-client-endpoint" I/O-1] - IoUtils.safeClose(IoUtils.java:133) - Closing resource org.xnio.nio.NioSocketStreamConnection@6048cca4

                [10:32:25,760]TRACE  1706[Remoting "config-based-ejb-client-endpoint" I/O-1] - ?.?(?:?) - Cancelling key sun.nio.ch.SelectionKeyImpl@36471861 of java.nio.channels.SocketChannel[closed] (same thread)

                [10:32:25,761]TRACE  1707[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:29,764] WARN  5710[main] - ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:156) - Could not register a EJB receiver for connection to 192.168.2.10:4447

                java.lang.RuntimeException: Operation failed with status WAITING

                  at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)

                  at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77)

                  at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)

                  at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:147)

                  at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115)

                  at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)

                  at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)

                  at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)

                  at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:176)

                  at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)

                  at com.sun.proxy.$Proxy6.countRegisteredUsers(Unknown Source)

                  at de.bomc.test.auth.ejb.RemoteEJBTest.test01_invokeRemoteEJBWithJAAS(RemoteEJBTest.java:61)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                  at java.lang.reflect.Method.invoke(Method.java:606)

                  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

                  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

                  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

                  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

                  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

                  at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

                  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

                  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

                  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

                  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

                  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

                  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

                  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

                [10:32:29,766]DEBUG  5712[main] - ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:160) - Registered a reconnect handler in EJB client context org.jboss.ejb.client.EJBClientContext@171c50d4 for remote://192.168.2.10:4447

                [10:32:29,767]DEBUG  5713[main] - ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:165) - Registered 0 remoting EJB receivers for EJB client context org.jboss.ejb.client.EJBClientContext@171c50d4

                [10:32:29,779]TRACE  5725[ejb-client-context-tasks-2-thread-1] - EndpointImpl.resourceUntick(EndpointImpl.java:186) - Allocated tick to 5 of endpoint "config-based-ejb-client-endpoint" <11498436> (opened Connection to /192.168.2.10:4447)

                [10:32:29,779]TRACE  5725[ejb-client-context-tasks-2-thread-1] - RemoteConnectionProvider.connect(RemoteConnectionProvider.java:145) - Attempting to connect to "/192.168.2.10:4447" with options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_DISALLOWED_MECHANISMS=>[JBOSS-LOCAL-USER]}

                [10:32:29,781]TRACE  5727[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:29,781]TRACE  5727[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.safeRun(WorkerThread.java:548) - Running task org.xnio.nio.WorkerThread$SynchTask@14d60d2b

                [10:32:29,781]TRACE  5727[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:29,781]TRACE  5727[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:29,782]TRACE  5728[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:30,782]TRACE  6728[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:30,783]TRACE  6729[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:523) - Selected key sun.nio.ch.SelectionKeyImpl@e865388 for java.nio.channels.SocketChannel[connection-pending local=/0:0:0:0:0:0:0:0:61986 remote=chabomc0-PC/192.168.2.150:4447]

                [10:32:30,784]TRACE  6730[Remoting "config-based-ejb-client-endpoint" I/O-1] - IoUtils.safeClose(IoUtils.java:133) - Closing resource org.xnio.nio.NioSocketStreamConnection@7a73ad16

                [10:32:30,785]TRACE  6731[Remoting "config-based-ejb-client-endpoint" I/O-1] - ?.?(?:?) - Cancelling key sun.nio.ch.SelectionKeyImpl@e865388 of java.nio.channels.SocketChannel[closed] (same thread)

                [10:32:30,785]TRACE  6731[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:493) - Beginning select on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:34,781]DEBUG 10727[ejb-client-context-tasks-2-thread-1] - MaxAttemptsReconnectHandler.tryConnect(MaxAttemptsReconnectHandler.java:70) - Re-connect attempt# 1 failed for 192.168.2.10:4447

                java.lang.RuntimeException: Operation failed with status WAITING

                  at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)

                  at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77)

                  at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)

                  at org.jboss.ejb.client.remoting.MaxAttemptsReconnectHandler.tryConnect(MaxAttemptsReconnectHandler.java:65)

                  at org.jboss.ejb.client.remoting.EJBClientContextConnectionReconnectHandler.reconnect(EJBClientContextConnectionReconnectHandler.java:56)

                  at org.jboss.ejb.client.EJBClientContext$ReconnectAttempt.run(EJBClientContext.java:1301)

                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

                  at java.util.concurrent.FutureTask.run(FutureTask.java:262)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                  at java.lang.Thread.run(Thread.java:724)

                [10:32:34,834]TRACE 10780[Thread-1] - AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:136) - Closing endpoint "config-based-ejb-client-endpoint" <11498436> synchronously

                [10:32:34,837]TRACE 10783[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,838]TRACE 10784[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,840]TRACE 10786[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Registration of 'https-remoting': Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,841]TRACE 10787[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,841]TRACE 10787[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Registration of 'https-remoting': Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,842]TRACE 10788[Thread-1] - AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:153) - Phase 1 shutdown count 00000004 of endpoint "config-based-ejb-client-endpoint" <11498436> (closed Remoting remote connection provider 7dcecd26 for endpoint "config-based-ejb-client-endpoint" <11498436>)

                [10:32:34,842]TRACE 10788[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,842]TRACE 10788[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,843]TRACE 10789[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Registration of 'remote': Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,843]TRACE 10789[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,844]TRACE 10790[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Registration of 'remote': Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,844]TRACE 10790[Thread-1] - AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:153) - Phase 1 shutdown count 00000003 of endpoint "config-based-ejb-client-endpoint" <11498436> (closed Remoting remote connection provider 74e312e for endpoint "config-based-ejb-client-endpoint" <11498436>)

                [10:32:34,845]TRACE 10791[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting remote connection provider 2d724ca6 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,846]TRACE 10792[Thread-1] - IoFuture$HandlingNotifier.notify(IoFuture.java:204) - Registered cancellation result

                [10:32:34,847]TRACE 10793[Thread-1] - AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:153) - Phase 1 shutdown count 00000002 of endpoint "config-based-ejb-client-endpoint" <11498436> (closed a cancelled connection)

                [10:32:34,849]TRACE 10795[Thread-1] - IoFuture$HandlingNotifier.notify(IoFuture.java:204) - Registered cancellation result

                [10:32:34,849]TRACE 10795[Thread-1] - AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:153) - Phase 1 shutdown count 00000001 of endpoint "config-based-ejb-client-endpoint" <11498436> (closed a cancelled connection)

                [10:32:34,850]TRACE 10796[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Remoting remote connection provider 2d724ca6 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,850]TRACE 10796[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Registration of 'http-remoting': Remoting remote connection provider 2d724ca6 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,851]TRACE 10797[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting remote connection provider 2d724ca6 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,854]TRACE 10800[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Registration of 'http-remoting': Remoting remote connection provider 2d724ca6 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,854]TRACE 10800[Thread-1] - EndpointImpl.finishPhase1(EndpointImpl.java:172) - Finished phase 1 shutdown of endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,855]TRACE 10801[Thread-1] - NioXnioWorker.shutdown(NioXnioWorker.java:229) - Initiating shutdown of org.xnio.nio.NioXnioWorker@143d2a58

                [10:32:34,855]TRACE 10801[Thread-1] - NioXnioWorker.closeResource(NioXnioWorker.java:203) - CAS org.xnio.nio.NioXnioWorker@143d2a58 80000002 -> 80000001

                [10:32:34,856]TRACE 10802[Thread-1] - AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:344) - Closing Remoting local connection provider 1afecda0 for endpoint "config-based-ejb-client-endpoint" <11498436> asynchronously

                [10:32:34,856]TRACE 10802[Thread-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of Remoting local connection provider 1afecda0 for endpoint "config-based-ejb-client-endpoint" <11498436>

                [10:32:34,857]TRACE 10803[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:507) - Selected on sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:34,857]TRACE 10803[Remoting "config-based-ejb-client-endpoint" I/O-1] - WorkerThread.run(WorkerThread.java:540) - Shutting down channel thread "Thread[Remoting "config-based-ejb-client-endpoint" I/O-1,5,main]"

                [10:32:34,858]TRACE 10804[Remoting "config-based-ejb-client-endpoint" I/O-1] - IoUtils.safeClose(IoUtils.java:194) - Closing resource sun.nio.ch.WindowsSelectorImpl@ed03465

                [10:32:34,858]TRACE 10804[Remoting "config-based-ejb-client-endpoint" I/O-1] - NioXnioWorker.closeResource(NioXnioWorker.java:203) - CAS org.xnio.nio.NioXnioWorker@143d2a58 80000001 -> 80000000

                [10:32:34,859]TRACE 10805[Remoting "config-based-ejb-client-endpoint" I/O-1] - NioXnioWorker.closeResource(NioXnioWorker.java:207) - CAS org.xnio.nio.NioXnioWorker@143d2a58 80000000 -> c0000000 (close complete)

                [10:32:34,859]TRACE 10805[Remoting "config-based-ejb-client-endpoint" I/O-1] - AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:260) - Completed close of endpoint "config-based-ejb-client-endpoint" <11498436>

                • 5. Re: Wildfly ejb remote access with jaas
                  Wolf-Dieter Fink Master

                  I'm not sure what you tried.

                  Do you change the libraries at client side and try to invoke a AS7.2.0 with port 8080? This will be impossible

                  Or do you change only this libraries and invoke an EJB deployed with a wildfly instance? In that case you should use the bin/client/jboss-client.jar instead of separate libraries as there might be other modules changed to use that features.