[jboss-user] [JBossCache] - Re: Problems about updating an ArrayList in replicated TreeC
jeyrich
do-not-reply at jboss.com
Wed Aug 30 07:40:08 EDT 2006
We see the same exception. Trying to reproduce it, I found I can only provoke it by having a circular reference. I have created a small test case (and created JBCACHE-757 (http://jira.jboss.com/jira/browse/JBCACHE-757) for it):
import org.jboss.cache.aop.PojoCache;
| import org.jboss.cache.aop.annotation.PojoCacheable;
|
| @PojoCacheable
| public class Main {
| public Main reference;
|
| public static void main(String[] args) throws Exception {
|
| PojoCache cache = new PojoCache();
| cache.startService();
|
| Main main = new Main();
| Main main2 = new Main();
|
| main.reference = main2;
| main2.reference = main;
|
| cache.putObject("/main",main);
|
| main2.reference = main; // <--
|
| System.out.println("Done...");
| }
| }
results in:
Exception in thread "main" java.lang.RuntimeException: PojoCache.putObject(): fqn: /main/reference/reference
| at org.jboss.cache.aop.PojoCache.putObject(PojoCache.java:478)
| at org.jboss.cache.aop.CacheInterceptor.invoke(CacheInterceptor.java:115)
| at org.jboss.aop.joinpoint.FieldWriteInvocation.invokeNext(FieldWriteInvocation.java:51)
| at Main.reference_w_$aop(Main.java)
| at Main.main(Main.java:21)
| Caused by: java.lang.IllegalStateException: AOPInstance.incrementRefCount(): source fqn: /main/reference/reference is already present.
| at org.jboss.cache.aop.AOPInstance.incrementRefCount(AOPInstance.java:92)
| at org.jboss.cache.aop.InternalDelegate.incrementRefCount(InternalDelegate.java:98)
| at org.jboss.cache.aop.ObjectGraphHandler.incrementRefCount(ObjectGraphHandler.java:212)
| at org.jboss.cache.aop.ObjectGraphHandler.setupRefCounting(ObjectGraphHandler.java:192)
| at org.jboss.cache.aop.ObjectGraphHandler.objectGraphPut(ObjectGraphHandler.java:88)
| at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:201)
| at org.jboss.cache.aop.PojoCache._putObject(PojoCache.java:731)
| at org.jboss.cache.aop.PojoCache.putObject(PojoCache.java:462)
| ... 4 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968340#3968340
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968340
More information about the jboss-user
mailing list