Remote EJB call: Authentication failed: the server presented no authentication mechanisms
miragpl Jul 10, 2014 10:42 AMHi everyone,
I got and issue with invoking remote EJB deployed Wildfly 8.1.0.Final that has been started with "standalone-full-ha.xml" configuration.
Whenever server is started on another host and I try to invoke a remote EJB from my standalone client i got following exception:
lip 10, 2014 1:48:55 PM org.jboss.ejb.client.EJBClient <clinit> INFO: JBoss EJB Client version 2.0.1.Final lip 10, 2014 1:48:56 PM org.xnio.Xnio <clinit> INFO: XNIO version 3.2.2.Final lip 10, 2014 1:48:56 PM org.xnio.nio.NioXnio <clinit> INFO: XNIO NIO Implementation Version 3.2.2.Final lip 10, 2014 1:48:56 PM org.jboss.remoting3.EndpointImpl <clinit> INFO: JBoss Remoting version 4.0.3.Final lip 10, 2014 1:48:58 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river] lip 10, 2014 1:48:58 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@3907b408, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@28bc9678,channel=jboss.ejb,nodename=TSM_1]} on channel Channel ID c6c2a3d7 (outbound) of Remoting connection 693a2c6a to /172.18.55.73:8080 lip 10, 2014 1:49:00 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river] lip 10, 2014 1:49:00 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@3907b408, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection@6ec6dd79,channel=jboss.ejb,nodename=TSM_2]} on channel Channel ID f42b3ea0 (outbound) of Remoting connection 1615f43d to /172.18.55.74:8080 lip 10, 2014 1:49:02 PM org.jboss.remoting3.remote.RemoteConnection handleException ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: the server presented no authentication mechanisms lip 10, 2014 1:49:02 PM org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager getEJBReceiver INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='TSM_2', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='172.18.55.74', destinationPort=8080}], resolvedDestination=[Destination address=172.18.55.74, 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
Despite the thrown exception the remote EJB call works correctly. The problem occurs only when Wildfly is running on another machine (locally all works fine) and has been started with standalone-full-ha.xml configuration - even when there is only one node active. When using standalone-full.xml such call works without an exception.
I'm using standard Wildfly (standalone-full-ha.xml) configurations without any changes. I'm attaching simple project that can be used to verify the problem. The run the project do following steps:
0. unpack the test.zip archive
1. add user to Wildfly (using add-user.sh script)
2. modify \test\client\src\main\resources\jboss-ejb-client.properties - fill newly added user/pass and provided proper hostname/ip address (remember that problem does not occur when run locally)
3. execute mvn clean install
4. copy test\dist\target\dist-0.1.0-SNAPSHOT to JBOSS_HOME/standalone/deployments
5. start Wildfly ./standalone.sh -c standalone-full-ha.xml -Djboss.node.name=NODE_2 -b xx.x.x.x -Djboss.bind.address.management=xx.x.x.x
6. execute mvn clean package shade:shade in test/client (to create executable jar )
7. run client from command line: java -jar target\client-0.1.0-SNAPSHOT.jar test.test.wildfly.TestClient
Thanks in advance for any hint!
-
test.zip 19.5 KB