3 Replies Latest reply on Feb 22, 2013 10:31 AM by will.tatam Branched from an earlier discussion.

    Connection authentication failures with remote EJB invocations

    will.tatam

      I am constistenly seeing an odd error with remoting calls

       

      When we call

       


      EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(p);

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

      EJBClientContext.setSelector(selector);

       

      We get the following error no matter what connection properties we supply.

       

      Feb 21, 2013 12:00:40 PM org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.7.GA

      Feb 21, 2013 12:00:40 PM org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.7.GA

      Feb 21, 2013 12:00:40 PM org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.14.GA

      Feb 21, 2013 12:00:40 PM org.jboss.remoting3.remote.RemoteConnection handleException

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

      Feb 21, 2013 12:00:40 PM org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector setupEJBReceivers

      WARN: Could not register a EJB receiver for connection to localhost:4447

      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.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:148)

          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:105)

          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:73)

          at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:81)

          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:90)

          at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:73)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.getIC(RemoteEJBClient.java:193)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.lookupRemoteStatelessCalculator(RemoteEJBClient.java:113)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:55)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(RemoteEJBClient.java:42)

      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: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:187)

          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.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:146)

          ... 9 more

       

      However if we then try and call a remote EJB it works fine.  If we set the wrong username and password, then we still see the same error, but when we try and invoke the remote EJB we get

       

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

      Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:jboss-as-ejb-remote-app, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@321e4dd0

          at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:693)

          at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)

          at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)

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

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

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

          at $Proxy0.add(Unknown Source)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:62)

          at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(RemoteEJBClient.java:42)

       

      I have tested this under 7.1.1, 7.1.3 and 7.2.0-Alpha1

       

      See see modified ejb-remote quickstart for an example