Uploaded image for project: 'EJB Client Library (AS7+)'
  1. EJB Client Library (AS7+)
  2. EJBCLIENT-211

Wildfly naming client can't invoke EJBs on EAP 7.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 4.0.0.Beta26
    • None
    • None

      InitialContext backed by Wildfly Naming Client like this:

      Properties env = new Properties();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"");
      env.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
      env.put("jboss.naming.client.ejb.context", "true");
      env.put(Context.SECURITY_PRINCIPAL, "joe");
      env.put(Context.SECURITY_CREDENTIALS, "joeIsAwesome2013!");
      InitialContext ctx = new InitialContext(env);
      

      lookup name for the EJB is /server/HelloBean!ejb.HelloBeanRemote (or without the slash at the beginning, I tried both)

      This works for invoking EJBs on EAP 7.1, but when the same is attempted against EAP 7.0, you get:

      Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000024: Not able to find EJB matching "StatelessEJBLocator for "/server/HelloBean", view is interface ejb.HelloBeanRemote, affinity is None"
      	at org.jboss.ejb.client.EJBClientContext.discoverAffinityNone(EJBClientContext.java:405)
      	at org.jboss.ejb.client.EJBClientContext.performLocatedAction(EJBClientContext.java:387)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:150)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:100)
      	at com.sun.proxy.$Proxy2.hello(Unknown Source)
      	at client.Client.main(Client.java:20)
      

      Reproducer attached.

            sdouglas1@redhat.com Stuart Douglas
            sdouglas1@redhat.com Stuart Douglas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: