NamingResources reads public void removeLocalEjb(String name) { entries.remove(name); ContextLocalEjb localEjb = null; synchronized (localEjbs) { localEjb = (ContextLocalEjb) ejbs.remove(name); } if (localEjb != null) { support.firePropertyChange("localEjb", localEjb, null); localEjb.setNamingResources(null); } } if should be public void removeLocalEjb(String name) { entries.remove(name); ContextLocalEjb localEjb = null; synchronized (localEjbs) { localEjb = (ContextLocalEjb) localEjbs.remove(name); // The error was in this line } if (localEjb != null) { support.firePropertyChange("localEjb", localEjb, null); localEjb.setNamingResources(null); } } Regards, lg
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