Summary: | ClassCastException at org.apache.catalina.deploy.NamingResources | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Lucas Galfaso <lgalfaso> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 6.0.14 | ||
Target Milestone: | default | ||
Hardware: | Other | ||
OS: | other |
Description
Lucas Galfaso
2007-09-24 19:41:40 UTC
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 Thanks for all your patches. Could you provide them in diff -u format as they are easier to read and apply that way. Cheers. Thanks for the patch. I had to make a few tweaks. See http://svn.apache.org/viewvc?rev=651675&view=rev It has been committed to trunk and proposed for 6.0.x This patch has been committed to 6.0.x and will be included in 6.0.17 |