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 2007/09/25 05:02:04 UTC
DO NOT REPLY [Bug 43470] - ClassCastException at org.apache.catalina.deploy.NamingResources
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43470>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=43470
------- Additional Comments From lgalfaso@gmail.com 2007-09-24 20:02 -------
There are some more bug at this same class
It reads
public void addResourceEnvRef(ContextResourceEnvRef resource) {
if (entries.containsKey(resource.getName())) {
return;
} else {
entries.put(resource.getName(), resource.getType());
}
synchronized (localEjbs) { // This is wrong
resource.setNamingResources(this);
resourceEnvRefs.put(resource.getName(), resource);
}
support.firePropertyChange("resourceEnvRef", null, resource);
}
Corrected version
public void addResourceEnvRef(ContextResourceEnvRef resource) {
if (entries.containsKey(resource.getName())) {
return;
} else {
entries.put(resource.getName(), resource.getType());
}
synchronized (resource) { // This is correct
resource.setNamingResources(this);
resourceEnvRefs.put(resource.getName(), resource);
}
support.firePropertyChange("resourceEnvRef", null, resource);
}
and
public void removeResourceEnvRef(String name) {
entries.remove(name);
String type = null;
synchronized (resourceEnvRefs) {
type = (String) resourceEnvRefs.remove(name);
}
if (type != null) {
support.firePropertyChange("resourceEnvRef",
name + ":" + type, null);
}
}
Should be
public void removeResourceEnvRef(String name) {
entries.remove(name);
ContextResourceEnvRef resourceEventRef = null;
synchronized (resourceEnvRefs) {
resourceEventRef = (ContextResourceEnvRef) resourceEnvRefs.remove(name);
}
if (resourceEventRef != null) {
support.firePropertyChange("resourceEnvRef",
name + ":" + resourceEventRef.getType(),
null);
}
}
Regards,
lg
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org