Hello,
I'm a new user of TreeCacheAop (v1.01). My cached (POJO) class is constructed of a
private HashMap member and a private reference to itself (same class) [to build a
tree-like object hierarchy/graph].
While loading (putObject) my objects' hierarchy to the TreeCacheAop I'm getting the
following exception:
Exception in thread "main" java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java(Compiled Code))
at java.util.HashMap$KeyIterator.next(HashMap.java:894)
at org.jboss.cache.aop.TreeCacheAop._removeObject(TreeCacheAop.java:548)
at org.jboss.cache.aop.TreeCacheAop._removeObject(TreeCacheAop.java:533)
at org.jboss.cache.aop.TreeCacheAop.removeObject(TreeCacheAop.java:503)
at org.jboss.cache.aop.TreeCacheAop.handleObjectGraph(TreeCacheAop.java:366)
at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:209)
at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:133)
at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:114)
at org.amir.TestDeviceCache.test(TestDeviceCache.java:245)
at org.amir.TestDeviceCache.main(TestDeviceCache.java:327)
It seems that the source of the exception is internal to the TreeCacheAop. I've
located the 'iteratorÃÂ that caused the exception:
~TreeCacheAop.java:548 method: "_removeObject":
protected Object _removeObject(Fqn fqn, boolean removeCacheInterceptor) throws
Exception
{
ÃÂ
} else if (Map.class.isAssignableFrom(clazz)) {
Map values = get(fqn).getChildren();
if (values != null) {
for (Iterator i = values.keySet().iterator(); i.hasNext();) {
Object key = i.next(); // EXCEPTION HERE (line 548)
_removeObject(new Fqn(fqn, key), removeCacheInterceptor);
}
}
} else if (Collection.class.isAssignableFrom(clazz)) {
Map values = get(fqn).getChildren();
int size = values == null ? 0 : values.size();
for (int i = 0; i < size; i++) {
_removeObject(new Fqn(fqn, new Integer(i)), removeCacheInterceptor);
}
}
Am I using the TreeCacheAop (Map support) wrong or is it something else?
My POJO class is:
public class Device {
public String name=null;
public Device parent=null;
public Map attributes=null;
public Device(){}
public String getName() {
return name;
}
public Device getParent() {
return parent;
}
public void setName(String name) {
this.name = name;
}
public void setParent(Device device) {
parent = device;
}
public void setAttributes(Map attrbiutesMap)
{
this.attributes = attrbiutesMap;
}
public Object getProperty(String propName)
{
Object obj = attributes.get(propName);
if (obj==null && parent != null){
obj = parent.getProperty(propName);
}
return obj;
}
}
The class is complied with aopc complier and is working great until its HashMap is
filled and the object is begin referenced by another.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838596#3838596
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838596
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development