3 Replies Latest reply on Nov 13, 2012 1:13 PM by caraldel

    SaslException when I'm trying to connect remotely to cluster EJB

    caraldel Newbie

      Hello,

       

      I have this issue, I try to pass some local Junit Test pointing to a remote clustered EJBs. The test pass but I get this trace error:

       

      PROPIEDADES = {jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false, java.naming.provider.url=remote://XXX.XXX.XXX.XXX:4447/, java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory, java.naming.security.authentification=none, jboss.naming.client.ejb.context=true, java.naming.security.principal=ejbuser, java.naming.factory.url.pkgs=org.jboss.ejb.client.naming, java.naming.security.credentials=jbsr_sgr}

      nov 09, 2012 10:05:13 AM org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.3.GA

      nov 09, 2012 10:05:13 AM org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.3.GA

      nov 09, 2012 10:05:13 AM org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.7.GA

      nov 09, 2012 10:05:14 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage

      INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]

      nov 09, 2012 10:05:14 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

      INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@c52ffa, receiver=Remoting connection EJB receiver [connection=Remoting connection <cebf1c>,channel=jboss.ejb,nodename=MW]} on channel Channel ID e8f61ab9 (outbound) of Remoting connection 008a9705 to /XXX.XXX.XXX.XXX:4447

      PROPIEDADES = {jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false, java.naming.provider.url=remote://XXX.XXX.XXX.XXX:4447/, java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory, java.naming.security.authentification=none, jboss.naming.client.ejb.context=true, java.naming.security.principal=ejbuser, java.naming.factory.url.pkgs=org.jboss.ejb.client.naming, java.naming.security.credentials=jbsr_sgr}

      nov 09, 2012 10:05:14 AM org.jboss.ejb.client.EJBClient <clinit>

      INFO: JBoss EJB Client version 1.0.10.Final

      nov 09, 2012 10:05:14 AM org.jboss.remoting3.remote.RemoteConnection handleException

      ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

      nov 09, 2012 10:05:14 AM org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager getEJBReceiver

      INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='MW', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='XXX.XXX.XXX.XXX', destinationPort=4447}], resolvedDestination=[Destination address=XXX.XXX.XXX.XXX, destination port=4447]} in cluster ejb

      java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

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

                at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:104)

                at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:406)

                at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:380)

                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

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

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

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

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

      Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

                at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:315)

                at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214)

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

                at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)

                at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)

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

                at org.xnio.nio.NioHandle.run(NioHandle.java:90)

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

                at ...asynchronous invocation...(Unknown Source)

                at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)

                at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386)

                at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:151)

                at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:132)

                at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:101)

                ... 7 more

       

      What is it wrong in my configuration ??? I put the jboss-ejb-client.properties in the source of my Junit Tests, but nothing changes.

       

      Thank you !

        • 1. Re: SaslException when I'm trying to connect remotely to cluster EJB
          caraldel Newbie

          If I delete the file jboss-ejb-client and I only put this properties file:

           

          java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory

          java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

          java.naming.provider.url=remote://XXX.XXX.XXX.XXX:4447/

          java.naming.security.principal=ejbuser

          java.naming.security.credentials=jbsr_sgr

          java.naming.security.authentification=none

          jboss.naming.client.ejb.context=true

           

           

          I have this error trace:

           

          PROPIEDADES = {jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false, java.naming.provider.url=remote://XXX.XXX.XXX.XXX/, java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory, java.naming.security.authentification=none, jboss.naming.client.ejb.context=true, java.naming.security.principal=ejbuser, java.naming.factory.url.pkgs=org.jboss.ejb.client.naming, java.naming.security.credentials=jbsr_sgr}

          nov 12, 2012 11:57:39 AM org.xnio.Xnio <clinit>

          INFO: XNIO Version 3.1.0.Beta7

          nov 12, 2012 11:57:39 AM org.xnio.nio.NioXnio <clinit>

          INFO: XNIO NIO Implementation Version 3.1.0.Beta7

          nov 12, 2012 11:57:39 AM org.jboss.remoting3.EndpointImpl <clinit>

          INFO: JBoss Remoting version 3.2.12.GA

          nov 12, 2012 11:57:39 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage

          INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]

          nov 12, 2012 11:57:39 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

          INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@1c0e6e, receiver=Remoting connection EJB receiver [connection=Remoting connection <6f411f>,channel=jboss.ejb,nodename=MW]} on channel Channel ID b11a37dc (outbound) of Remoting connection 00c85c1f to /XXX.XXX.XXX.XXX:4447

          nov 12, 2012 11:57:39 AM org.jboss.ejb.client.EJBClient <clinit>

          INFO: JBoss EJB Client version 1.0.13.Final

          nov 12, 2012 11:57:39 AM org.jboss.remoting3.remote.RemoteConnection handleException

          ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

          nov 12, 2012 11:57:39 AM org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager getEJBReceiver

          INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='MW', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='XXX.XXX.XXX.XXX', destinationPort=4447}], resolvedDestination=[Destination address=XXX.XXX.XXX.XXX, destination port=4447]} in cluster ejb

          java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

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

                    at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:115)

                    at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:406)

                    at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:380)

                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

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

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

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

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

          Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

                    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:332)

                    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:225)

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

                    at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:188)

                    at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:102)

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

                    at org.xnio.nio.NioHandle.run(NioHandle.java:156)

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

                    at ...asynchronous invocation...(Unknown Source)

                    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)

                    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386)

                    at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:151)

                    at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:132)

                    at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:113)

                    ... 7 more

           

          PROPIEDADES = {jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false, java.naming.provider.url=remote://XXX.XXX.XXX.XXX/, java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory, java.naming.security.authentification=none, jboss.naming.client.ejb.context=true, java.naming.security.principal=ejbuser, java.naming.factory.url.pkgs=org.jboss.ejb.client.naming, java.naming.security.credentials=jbsr_sgr}

          nov 12, 2012 11:57:39 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage

          INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]

          nov 12, 2012 11:57:39 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

          INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@16c72cc, receiver=Remoting connection EJB receiver [connection=Remoting connection <6f411f>,channel=jboss.ejb,nodename=MW]} on channel Channel ID f3438947 (outbound) of Remoting connection 00c85c1f to /XXX.XXX.XXX.XXX:4447

          • 2. Re: SaslException when I'm trying to connect remotely to cluster EJB
            Radoslav Husar Master

            At first sight it seems as though everything is working for you, but you just get a logging message that you havent used any authentication memchanism. You seem to run that on a local machine so silet auth kicks in instead, this is to be expected in 7.1.1, please look at https://issues.jboss.org/browse/AS7-4309

             

            Rado

            • 3. Re: SaslException when I'm trying to connect remotely to cluster EJB
              caraldel Newbie

              I solve the issue. I put only in src/main/resources this two properties files:

               

              jndi.properties:

               

              java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

               

               

              jboss-ejb-client.properties:

               

              endpoint.name=client-endpoint

              remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

               

              remote.connections=default

               

              remote.connection.default.host=XXX.XXX.XXX.XXX

              remote.connection.default.port=4447

              remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

              remote.connection.default.username=ejbuser

              remote.connection.default.password=jbsr

               

              remote.clusters=ejb

               

              remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

              remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED=false

              remote.cluster.ejb.username=ejbuser

              remote.cluster.ejb.password=jbsr