EJB 3.1 lookup from client.
mauriclaudio Jan 2, 2012 1:01 PMGood 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:
{code}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
{code}
Client code is very simple, and exactly copied & adapted from sample:
{code}
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);
}
{code}
By the way, SampleEJB is correctly deployed as from JBoss log:
{code}
java:global/SampleEJB/Sample!test.SampleRemote
java:app/SampleEJB/Sample!test.SampleRemote
java:module/Sample!test.SampleRemote
java:global/SampleEJB/Sample
java:app/SampleEJB/Sample
java:module/Sample
{code}
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.