I've been trying to create a standalone java app that connects to a EJB in a JBOSS As 7.1.1. I'm going through this tutorial: https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI
Problem is, I just can't connect to the EJB. I'm always getting a IllegalStateException as follows
Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:testeWeb-web-0.0.1-SNAPSHOT,modulename:testeWeb-ejb-0.0.1-SNAPSHOT,distinctname:] combination
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:485)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:84)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:122)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:107)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:90)
at com.sun.proxy.$Proxy0.getSenha(Unknown Source)
at testes.TesteCodigo.main(TesteCodigo.java:94)
Thing is. I have no idea how to correctly form the JNDI lookup String. Here's the loojup code i'm using private static TesteFacade lookupFacade() throws NamingException{ final Hashtable jndiProperties = new Hashtable(); jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
final Context context = new InitialContext(jndiProperties);
return (TesteFacade) context.lookup("ejb:testeWeb-web-0.0.1-SNAPSHOT/testeWeb-ejb-0.0.1-SNAPSHOT//TesteFacadeImpl!facade.TesteFacade");
}
and here's the deployment log for that EJB:
java:global/testeWeb/testeWeb-ejb-0.0.1-SNAPSHOT/TesteFacadeImpl!facade.TesteFacade
java:app/testeWeb-ejb-0.0.1-SNAPSHOT/TesteFacadeImpl!facade.TesteFacade
java:module/TesteFacadeImpl!facade.TesteFacade
java:jboss/exported/testeWeb/testeWeb-ejb-0.0.1-SNAPSHOT/TesteFacadeImpl!facade.TesteFacade
java:global/testeWeb/testeWeb-ejb-0.0.1-SNAPSHOT/TesteFacadeImpl
java:app/testeWeb-ejb-0.0.1-SNAPSHOT/TesteFacadeImpl
java:module/TesteFacadeImpl
how should I create the JNDI lookup string?