You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/09/24 13:59:27 UTC
DO NOT REPLY [Bug 49994] New: NamingContext Possible Bug
https://issues.apache.org/bugzilla/show_bug.cgi?id=49994
Summary: NamingContext Possible Bug
Product: Tomcat 7
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: gurkanerdogdu@yahoo.com
In NamingContext implementation, if "lookup()" is a Reference, current
implementation caches the result of the NamingManager # getObjectInstance via
following statements and changes the type of the entry. In the following
lookups, same object is returned. I would like to write ObjectFactory that
returns new instance for each time lookup is called on its reference. But with
the current implementation, it is not possible to write such an object factory
because of aferomentioned sitaution. I think that entry must be stay as
Reference instead of changing entry type.
NamingContext class:
protected Object lookup(Name name, boolean resolveLinks)
throws NamingException {
.....
} else if (entry.type == NamingEntry.REFERENCE) {
try {
Object obj = NamingManager.getObjectInstance
(entry.value, name, this, env);
if (obj != null) {
entry.value = obj;
entry.type = NamingEntry.ENTRY; ---> CHANGES type of
the naming entry
}
return obj;
} catch (NamingException e) {
throw e;
} catch (Exception e) {
log.warn(sm.getString
("namingContext.failResolvingReference"), e);
throw new NamingException(e.getMessage());
}
}
...........
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 49994] NamingContext Possible Bug
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49994
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #2 from Mark Thomas <ma...@apache.org> 2010-10-08 07:59:54 EDT ---
This has been fixed in trunk and will be included in 7.0.4 onwards. I also
added a test case for this and a related issue (bug 23950).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 49994] NamingContext Possible Bug
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49994
--- Comment #3 from Mark Thomas <ma...@apache.org> 2010-11-04 14:03:17 EDT ---
Note this behaviour will be configurable from 7.0.5 onwards and will default to
the previous behaviour of returning the same object for each lookup.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 49994] NamingContext Possible Bug
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49994
--- Comment #1 from Gurkan Erdogdu <gu...@yahoo.com> 2010-09-24 08:00:08 EDT ---
Comments from David Jencks:
For reference, the EE 6 platform spec explains that usually a new instance
should be returned on each lookup in section 5.2.4 page 67 "Sharing of
Environment Entries". The servlet 3.0 spec section 15.2.2 page 174 indicates
that this applies to servlet containers that are part of an EE
technology-compliant implementation. I guess this means that unless tomcat
implements web profile they don't have to support this? It still seems like a
good idea to me.
thanks
david jencks
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org