The current default jndi binding scheme
http://www.jboss.org/community/docs/DOC-9569
doesn't take into account the module name of the EJB. For example, if i have an ear
named MyApp.ear containing 2 jar files First.jar and Second.jar and both containing a bean
implementation AppManagerBean:
First.jar:
| package org.myapp.first.impl;
|
| @Stateless
| @Remote (org.myapp.first.AppManager.class)
| public class AppManagerBean implements org.myapp.first.AppManager {
|
| public String getVersion() {
| return "1.0";
| }
|
|
| }
|
Second.jar
package org.myapp.second.impl;
|
|
| @Stateless
| @Remote (org.myapp.second.AppManager.class)
| public class AppManagerBean implements org.myapp.second.AppManager {
| public String getVersion() {
| return "2.0";
| }
|
| }
|
Then as per the default JNDI naming scheme both these beans will resolve to
MyApp/AppManagerBean/remote. From what i see in the current version, only one bean (the
first one) gets bound to the JNDI and the other bean does not get bound:
+- MyApp (class: org.jnp.interfaces.NamingContext)
| | +- AppManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- remote (class: Proxy for: org.myapp.first.AppManager)
| | | +- remote-org.myapp.first.AppManager (class: Proxy for:
org.myapp.first.AppManager)
|
Shouldn't we be logging a WARN message in the logs letting the user know of this
conflict?
P.S: EJB3.1 spec seems to address this with the global jndi name scheme which results in a
unique jndi name in these cases.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183029#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...