6 Replies Latest reply on Feb 17, 2014 3:35 AM by wdfink

    No EJB receiver available for handling

    yck

      Hi,

      I am trying to conect to a remote ejb  on my local JBoss 7.2 from an executable java app (local not on Jboss).

      But i get the following error/Exception :

       

       

      0
      3[main] INFO  com.ris.client.PACSServiceTest  - ejb:xx-xx/xx-xx-business-impl//TestServiceBean!com.xx.business.api.TestService

      59   [main] INFO  org.jboss.ejb.client  - JBoss EJB Client version 1.0.16.Final

      122  [main] INFO  org.xnio  - XNIO Version 3.0.7.GA

      127  [main] INFO  org.xnio.nio  - XNIO NIO Implementation Version 3.0.7.GA

      139  [main] INFO  org.jboss.remoting  - JBoss Remoting version 3.2.14.GA

      362  [Remoting "config-based-ejb-client-endpoint" read-1] ERROR org.jboss.remoting.remote.connection  - JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

      365  [main] WARN  org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector  - 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.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:156)

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

          at com.sun.proxy.$Proxy0.getX(Unknown Source)

          at com...ris.client.PACSServiceTest.main(PACSServiceTest.java:71)

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

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

          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)

          ... 7 more

      383  [Remoting "config-based-ejb-client-endpoint" read-1] ERROR org.jboss.remoting.remote.connection  - JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:xx-xx, moduleName:xx-xx-business-impl, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@14bc02d

          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 com.sun.proxy.$Proxy0.getX(Unknown Source)

          at com...ris.client.PACSServiceTest.main(PACSServiceTest.java:71)

       

      The test remote bean TestService and its implmentationis in an .ear

       

      Server Classes :

      @Remote
      public interface TestService {
      
          public int getX();
      
      }
      
      
      @Stateless
      @Remote(TestService.class)
      public class TestServiceBean implements TestService{
      
          /* (non-Javadoc)
           * @see com.xx.xx.dicom.business.api.TestService#getX()
           */
          @Override
          public int getX() {
              // TODO Auto-generated method stub
              return 1111;
          }
      
      }
      
      
      

       

      Client code :

       

        final Hashtable jndiProperties = new Hashtable();
                  jndiProperties.put(Context.URL_PKG_PREFIXES,
                          "org.jboss.ejb.client.naming");
             
             
             
                  String jndiName = "ejb:xx-dicom/xx-xx-business-impl//TestServiceBean!"
                          + TestService.class.getName();
                  logger.info(jndiName);
             
                  final Context context = new InitialContext(jndiProperties);
                  TestService service = (TestService) context
                          .lookup(jndiName);
      
                 logger.info(service.getX());
      
      
      

       

       

      jboss-ejb-client.properties

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
      remote.connections=default
      remote.connection.default.host=localhost
      remote.connection.default.port =4447
      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      remote.connection.default.username=ARZT RAD
      remote.connection.default.password=a
      
      
      

       

       

      client dependencies :

       

       

       

      Any ideas ? Thanks in advance!

        • 1. Re: No EJB receiver available for handling
          sfcoy

          You are getting an authentication failure. Have you set your security up properly?

          • 2. Re: No EJB receiver available for handling
            wdfink

            Often the add_user command is used but the default is the management realm, you need to use the ApplicationRealm for this. Add -a if you use command line, otherwise select the applicaiton user.

            • 3. Re: No EJB receiver available for handling
              yck

              It works with jboss-ejb-client 7.1.0-final.. But not with 7.2.. Isbthere any explanation for this?

              • 4. Re: No EJB receiver available for handling
                wdfink

                As I'm able to run such scenario with AS7.2 and EAP6.1 (based on AS7.2) I suppose there is something wrong with your environment.

                 

                Did you use the correct client.jar, and did not have any other sub-libraries included in your classpath or archive?

                If I look to the log there is a version information that you use ejb-client 1.0.16 which is definitive not AS7.2

                • 5. Re: No EJB receiver available for handling
                  yck

                  Hallo Dieter, I have the client-bom in pom.xml with the version 7.1.0-FINAL when i change it to 7.2.0-FINAL, i get this exception(in the project above is the bom version 7.2.0-Final and the version 1.0.16 is managed by boom). Another case is when i have the bom version 7.2.0_Final and add the jboss-as-naming  dependency the saslexception disappears but the IllegalStateException still comes. Which version of jboss-ejb-client should i use (Server side applications are running on JBoss AS 7.2 and teh server app has the client bom with version 7.2.0-Final since its also calls othe remote ejbs)? and what other dependencies do i need exactly to be able to invoke a remote ejb from a desktop client ?

                  • 6. Re: No EJB receiver available for handling
                    wdfink

                    You might use a JBoss quickstart as example for the pom.xml settings.

                     

                    But I would check that the client application did not include any JBoss client library and start the desktop client separate with the classpath set to your <server>/bin/client/client.jar.

                    In this case you have all dependencies which you need to invoke EJB remotely.

                    If that works you are sure that the only problem is your pom setting and you can concentrate on this.