11 Replies Latest reply on Jan 5, 2012 8:36 AM by Radoslav Husar

    EJB 3.1 lookup from client.

    mauriclaudio Newbie

      Good evening,


      I'm trying to use remote EJB lookup, with JBoss AS7.1.0 CR1 as mentioned in https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI


      but actually, no luck.


      I've developed a very simple EJB 3.1 project, but when I try to look up my ejb from a client, I get this exception:



      Lookup ejb:/SampleEJB//Sample!test.SampleRemote

      gen 02, 2012 6:38:38 PM org.jboss.ejb.client.EJBClient <clinit>

      INFO: JBoss EJB Client version 1.0.0.Beta11

      gen 02, 2012 6:38:38 PM org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.0.CR7

      gen 02, 2012 6:38:38 PM org.jboss.ejb.client.ConfigBasedEJBClientContextSelector createConnections

      ERROR: Could not create connection for connection named default

      java.lang.IllegalArgumentException: No matching XNIO provider found



      Client code is very simple, and exactly copied & adapted from sample:



      public SampleRemote getReference() throws NamingException {

               final Hashtable jndiProperties = new Hashtable();       

               jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");       

               final Context context = new InitialContext(jndiProperties);

               final String appName = "";

               final String moduleName = "SampleEJB";

               final String distinctName = "";

               final String beanName = "Sample";

                // the remote view fully qualified class name      

               final String viewClassName = SampleRemote.class.getName();

               String jndiID = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;

               System.out.println(" Lookup "+jndiID);

               return (SampleRemote)context.lookup(jndiID);





      By the way, SampleEJB is correctly deployed as from JBoss log:














      Of course, I did not forget to specify an jboss-ejb-client properties file as described in the cited document...

      What can I try and check to get this sample working ?


      Thank you in advance.