Skip to main content

Question about Glassfish-specific JNDI naming

4 replies [Last post]
eudesf
Offline
Joined: 2010-03-03

Hello!
I've been in trouble with Glassfish v3 JNDI naming last days... Then I have made some tests and realize that:
When we use a bean with two interfaces or a no-interface bean inside an EAR, Glassfish uses JNDI names prefixed by EAR name as defined in the EJB 3.1 specification. It is great!
But when we deploy a bean (also in an EAR) with only one remote interface, the Glassfish publishes Glassfish-specific names (full qualified name of the remote interface), as used in versions earlier than v3.
Is this OK?
If yes, why the Glassfish-specific (non-portable) names are used in this case? There is any way to avoid this, without making changes in sun-ejb-jar.xml for each bean?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ksak
Offline
Joined: 2005-05-20

There's no formal relationship between the GlassFish-specific global JNDI names and the EJB 3.1 specified portable JNDI names. GlassFish has always had its own proprietary global JNDI name scheme. That still applies in V3 for backward compatibility.

For those GlassFish-specific global JNDI names, a default name is only created if the Session bean exposes a single remote interface. The full rules are in the EJB FAQ : https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#SessionBeanGloba...

The GlassFish-specific(non-portable) and portable EJB 3.1 JNDI names use different namespaces, so there's no possibility for clashing. It just means in some cases there is more than one string that can resolve to a particular client view of a session bean. In fact, it's possible to create additional ones as well : http://blogs.sun.com/kensaks/entry/application_specified_portable_jndi_n...

eudesf
Offline
Joined: 2010-03-03

Thanks for reply!
I understand that there are no clashing between Glassfish-specific names and those defined by EJB 3.1.
But, just because Glassfish implicity includes its specific JNDI names for backwards compatibility, when we have one single remote interface, I am in trouble. Because all of my beans are defined with one remote interface. In this way, I can't publish two EARs of my app that uses the same bean classes in the same Glassfish domain, because it will result in a clash.
As a result, I will have to create two domains, one for each app, just because of the JNDI conflict? Too much waste of memory, no?
So, there are any way to deactivate the Glassfish-specific JNDI names, that are in use just for backwards compatibility?

ksak
Offline
Joined: 2005-05-20

I see your point. We don't currently have an option to disable the GlassFish-specific JNDI behavior. Please file an RFE so we can consider adding it. Thanks.

eudesf
Offline
Joined: 2010-03-03

OK. I have made an RFE. I hope it can be considered.

https://glassfish.dev.java.net/issues/show_bug.cgi?id=11729

Thanks!