JNDI alias for ejb module name
canderwald Sep 30, 2016 10:44 AMHi,
after the migration of a JBoss 7.1.3 application to WildFly 10.1, some ejb module names have changed. The JNDI lookups of the new remote clients are working without any problems. But there exist some legacy remote clients that are still using the old ejb module name for the JNDI lookup.
Example:
The jar / ejb module name has changed from wildfly-sandbox-ejb to wildfly-sandbox-ejb-new.
Deployed EJB at WildFly startup:
12:45:55,795 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-2) WFLYEJB0473: JNDI bindings for session bean named 'SampleBeanRemoteImpl' in deployment unit 'subdeployment "wildfly-sandbox-ejb-new.jar" of deployment "wildfly-sandbox.ear"' are as follows:
java:global/wildfly-sandbox/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote
java:app/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote
java:module/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote
java:jboss/exported/wildfly-sandbox/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote
java:global/wildfly-sandbox/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl
java:app/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl
java:module/SampleBeanRemoteImpl
JNDI lookup string of the new remote Client:
ejb:wildfly-sandbox/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote
JNDI lookup string of the old remote Client:
ejb:wildfly-sandbox/wildfly-sandbox-ejb/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote
Not really a surprise - the lookup of the old client doesn't work. The bean itself and the code haven't changed, it is just a lookup problem. Is there any way to define an alias for the ejb module names? I tried to solve this problem with JNDI name alias in the naming module, e.g.
<lookup name="java:jboss/exported/wildfly-sandbox/wildfly-sandbox-ejb/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote" lookup="java:jboss/exported/wildfly-sandbox/wildfly-sandbox-ejb-new/SampleBeanRemoteImpl!de.gebit.dst.jboss.api.SampleBeanRemote"/>
but it doesn't work. Any idea?
Regards
Claus