1 Reply Latest reply on Aug 9, 2013 9:53 AM by jaikiran pai

    EJB Client access - working sample?

    Juergen Weber Newbie

      Hi,

       

      has anybody a working sample for an application client calling an EJB with security enabled?

       

      I tried the Custom Security-Domain and RolesAllowed EJB3 on JBossAS7.1.1Final sample from http://middlewaremagic.com/jboss/?p=2171

      but it did not work neither on jboss-as-7.1.1.Final nor on jboss-eap-6.1.0.

       

      On 7.1.1 I get the client output below.

       

      Without @RolesAllowed it works with client and server on Windows, but not with the server on Linux.

       

      Thanks,

      Juergen

       

      file:/D:/eclipseworkspace/Custom_SecurityDomain_EJB3_AS711/jboss-ejb-client.properties

      09.08.2013 15:25:53 org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.3.GA

      09.08.2013 15:25:53 org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.3.GA

      09.08.2013 15:25:53 org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.3.GA

      09.08.2013 15:25:53 org.jboss.remoting3.remote.RemoteConnection handleException

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

      javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed]

          at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)

          at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)

          at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

          at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

          at javax.naming.InitialContext.init(InitialContext.java:223)

          at javax.naming.InitialContext.<init>(InitialContext.java:197)

          at client.TestRemoteClientA.main(TestRemoteClientA.java:32)

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

          at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:87)

          at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)

          at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)

          at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)

          at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)

          ... 5 more

      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.doConnect(EndpointImpl.java:251)

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

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

          at org.jboss.naming.remote.client.EndpointCache$EndpointWrapper.connect(EndpointCache.java:105)

          at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:55)

          ... 8 more

      Exception in thread "main" java.lang.NullPointerException

          at client.TestRemoteClientA.main(TestRemoteClientA.java:43)