3 Replies Latest reply on May 30, 2015 1:54 PM by wdfink

    Cluster EJB  Authentication Issue

    abhinav.gupta01

      Hi All,

      I am facing issue while authentication over clustered EJB. I am using WildFly 8.1 Final  in domain mode with full-ha profile. Two different nodes are used to form a cluster for ejb , and deployment is success on that.
      When both my nodes are up and running and I try to connect to any one of nodes, I got authentication error for one of node :

      Below is trace :
      INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='slave:server-one-v', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='130.21.185.205', destinationPort=8080}], resolvedDestination=[Destination address=130.21.185.205, destination port=8080]} in cluster ejb
      java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: the server presented no authentication mechanisms
      at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92)
      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.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:79)
      at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:405)
      at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.call(ClusterContext.java:379)
      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:744)
      Caused by: javax.security.sasl.SaslException: Authentication failed: the server presented no authentication mechanisms
      at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:388)
      at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:242)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:196)
      at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:110)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      at org.xnio.ChannelListeners$DelegatingChannelListener.handleEvent(ChannelListeners.java:1092)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87)
      at org.xnio.nio.WorkerThread.run(WorkerThread.java:539)
      at ...asynchronous invocation...(Unknown Source)
      at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:272)
      at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:388)
      at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:153)
      at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:133)
      at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:75)
      ... 8 more


      I am using eclipse as client for testing purpose. Below is code :
        final Properties jndiProperties = new Properties();
         
                  jndiProperties.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");
                  jndiProperties.put("java.naming.provider.url", "http-remoting://abgupta2l:8080");
                  jndiProperties.put("java.naming.security.principal", "ejb");
                  jndiProperties.put("java.naming.security.credentials", "test");
                  jndiProperties.put("jboss.naming.client.ejb.context", "true");
            
                  final javax.naming.Context context = new javax.naming.InitialContext(jndiProperties);
          
                  Object obj =  context.lookup("jndiName");
            
      Issue occurs during lookup. Now when I turn "jboss.naming.client.ejb.context" to "false" , since at time of lookup connection is not made , and I see its done at first method invocation. It works Ok.

      But my application is dependent on first connection during lookup. So I cant change this property.


      I tried putting jboss-ejb-client.properties in eclipse classpath , but it also not work. Below is my jboss-ejb-client.properties :
      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
      remote.connections=default
      remote.connection.default.host=abgupta2l
      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=ejb
      remote.cluster.ejb.password=test
      remote.connection.default.port=8080
      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      remote.connection.default.username=ejb
      remote.connection.default.password=test

       

      Not sure if this is possible of not. If possible what change I need to do to get it work. Please suggest.