This content has been marked as final.
Show 3 replies
-
1. Re: How To Modify Global JNDI Name
crucifix Sep 24, 2008 6:42 PM (in response to crucifix)Correction, I cannot find a way to change the <ear-name> part without renaming my ear, not <ejb-name>.
-
2. Re: How To Modify Global JNDI Name
jaikiran Sep 25, 2008 2:10 AM (in response to crucifix)You can use the JBoss specific @RemoteBinding and @LocalBinding annotations to bind the EJB to the jndi name of your choice.
@Stateless @Local(com.mycomp.MyLocal.class) @Remote(com.mycomp.MyRemote.class) @LocalBinding(jndiBinding="MyLocalJNDIName") @RemoteBinding(jndiBinding="MyRemoteJNDIName") public class MyBean implements MyLocal, MyRemote { ... }
For the remote interface, you can use MyRemoteJNDIName in the lookup and for the local interface you can use MyLocalJNDIName. -
3. Re: How To Modify Global JNDI Name
crucifix Sep 25, 2008 12:07 PM (in response to crucifix)This is exactly what I wanted. Thanks so much for your help!
I see I no longer need to specify the 'name' in the @Stateless attribute either. This is my Global JNDI Namespace before and after the change:
Before:@Stateless(name="TestEJB") @Remote(IPing.class)
+- TestEAR-1.0.0 (class: org.jnp.interfaces.NamingContext) | +- TestEJB (class: org.jnp.interfaces.NamingContext) | | +- remote (proxy: $Proxy161 implements interface test.IPing,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
After:@Stateless @Remote(IPing.class) @RemoteBinding(jndiBinding="TestEAR/TestEJB/remote")
+- TestEAR (class: org.jnp.interfaces.NamingContext) | +- TestEJB (class: org.jnp.interfaces.NamingContext) | | +- remote (proxy: $Proxy177 implements interface test.Ping,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)