[GLASSFISH-18564] Naming should use standard lookup names for injection Created: 27/Mar/12  Updated: 29/May/13

Status: In Progress
Project: glassfish
Component/s: naming
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: marina vatkina Assignee: guojun.shan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


There is somewhere a disconnect between how naming works through proxies for lookup() of EJB TimerService or EJBContext (may be others) vs. falling back into v2-style code (ComponentEnvManagerImpl.EjbContextProxy) for injection of those types.

The error might be on the DOL registration, so if it is please reassign.

This is the callstack of the "wrong" sequence:

at com.sun.ejb.EjbNamingReferenceManagerImpl.getEJBContextObject(EjbNamingReferenceManagerImpl.java:226)
at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbContextProxy.create(ComponentEnvManagerImpl.java:915)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:169)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:500)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:457)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:614)

Comment by Cheng Fang [ 14/Jun/12 ]

When looking up these well-known resources by their portable jndi names (e.g., java:comp/EJBContext, java:comp/TimerService, etc), the result is retrieved from the preloaded list of named naming proxies.

When processing @Resource injections of these well-known resources, the reference name to look up is usually in the form java:comp/env/<full-class-name>/<field-name>, which follows a different path. I'll check if we can canonicalize the lookup name earlier.

Comment by Tom Mueller [ 15/Feb/13 ]

Reassigning to component lead as the assignee is no longer with the project.

Generated at Thu Aug 25 17:31:19 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.