Cannot lookup an EJB in a war, when same war deployed with different distinct name in JBoss EAP 6
Issue
In the war file, we have jboss-web.xml as
<jboss-web>
<distinct-name>${company.distinctName:dev1}</distinct-name>
</jboss-web>
So we can deploy it with different distinct name by specifying -Dcompany.distinctName=XXXX
So if we have remote.connections=dev1,dev2, look up of DEV1 will succeed but DEV2 will failed and vice versa. All this done without touching server sides at all. For the look-up that failed, we got the following exception:
java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:ClientServer,distinctname:dev1] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1cad6513<br> 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 $Proxy0.getBeanName(Unknown Source)
at com.jboss.examples.Client.main(Client.java:32)
Environment
- JBoss Enterprise Application Platform (EAP)
- 6
- EJB 3 Lite (ejb in war)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.