Ejb lookup failure : No EJB receiver available for handling ... bla bla combination for invocation context org.jboss.ejb.client
charlesjg Mar 25, 2013 5:43 AMHello all,
I am quite new in jboss AS development, so... sorry if my question is not very clever .
Actually, i am looking for an answer for a while, and I mass googled for that.
here, the trace of my problem:
java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:dao-business-services-1.0-SNAPSHOT,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1fb1fd2
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
at sun.proxy.$Proxy71.getProcessDone(Unknown Source)
I build a small project, stand alone, and the lookup run without any problem. This trace comes from the execution of my lookup inside a Spring controller. (web app, .war). I use jetty for the client app. (websocket support).
here my context building:
String JBOSS_CONTEXT = "org.jboss.naming.remote.client.InitialContextFactory";
jndiProperties = new Properties();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, JBOSS_CONTEXT);
jndiProperties.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "testuser");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "testpass");
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
try {
this.context = new InitialContext(jndiProperties);
} catch (NamingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
and here, an example of lookup:
public void tryToRetrieveProcessManagerEjb() {
processManagerRetrieveOk = true;
try {
processManager = (ProcessManager) context.lookup("dao-business-services-1.0-SNAPSHOT/ProcessManagerImpl!fr.syneo.traitementdechet.manager.process.ProcessManager");
} catch (NamingException e) {
e.printStackTrace();
processManagerRetrieveOk = false;
}
}
Last things:
When i rebuild my context before each ejb lookup, its ok... no "No EJB receiver available for handling bla bla bla " exception.
with someting like that:
this.context = new InitialContext(jndiProperties);
processManager = (ProcessManager) context.lookup("dao-business-services-1.0-SNAPSHOT/ProcessManagerImpl!fr.syneo.traitementdechet.manager.process.ProcessManager");
and then use the getter of the ejb proxy in my controller.
I really dont get it, and some advice will be greatly appreciated. (sry for english... frenchy dev spotted ).
Thx in advance,
Charles.