[jboss-user] [JBossCache] - Re: Threading Bug in PojoCache?

mvlior do-not-reply at jboss.com
Wed May 9 15:14:11 EDT 2007


Hi,

I've been seeing the same exception in a somewhat different scenario, but perhaps there is a connection, this being the only post mentioning 
"null PojoInstance for fqn"...

Basically, I'm running a replciated cache on two different JVMs. One attaches a POJO and then detaches it, while the other tries to acces it within a org.jboss.cache.CacheListener#nodeRemoved() method. AFAIK the notifier call is on the same thread.

The goal was to get a remote notification for POJO creation/deletion.

Below is the exception that occurs whenever this runs:
	/**
  | 	 * @see org.jboss.cache.CacheListener#nodeRemoved(org.jboss.cache.Fqn, boolean, boolean, java.util.Map)
  | 	 */
  | 	public void nodeRemoved(Fqn fqn, boolean pre, boolean isLocal, Map<Object, Object> data) {
  | 		log.info("nodeRemoved " + (pre?"pre ":"post ") + (isLocal?"local ":"remote ") + "fqn=" + fqn + " data:" + data);
  | 		if (pre) {
  | 			log.debug("FQN is: " + fqn + ", and the cache is currently " + cache);
  | 			if (fqn.toString().startsWith("__JBossInternal__")) {
  | 				log.trace("(JBoss internal stuff)");
  | 				
  | 			} else {
  | 				// our object !
  | 				Object object = cache.find("/person/test1"); // causes the exception, returns null
  | 				log.info("\nSomething is about to be removed. Something==" + object + '\n');
  | 			}
  | 		}
  | 	}

Here's the exception, in cotext.  If the line "cache.find(....)" is commented-out, everything seems to work just fine.

2007-05-09 22:03:33,906 INFO  [ReplicationDest] (Incoming Thread,192.168.0.112:1170) Modified for removal. Checking data:
  | 2007-05-09 22:03:33,906 INFO  [ReplicationDest] (Incoming Thread,192.168.0.112:1170) Pojo instance is: PI[fqn=null ref=0 class=org.jboss.cache.pojo.test.Person]
  | 2007-05-09 22:03:33,906 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited post fqn=/__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3
  | 2007-05-09 22:03:33,906 INFO  [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeRemoved pre remote fqn=/__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3 data:{}
  | 2007-05-09 22:03:33,921 DEBUG [ReplicationDest] (Incoming Thread,192.168.0.112:1170) FQN is: /__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3, and the cache is currently org.jboss.cache.pojo.impl.PojoCacheImpl cache=/__JBossInternal__ 0
  |     /person 0
  |         /test1 0
  |             /_ID_ 0
  |                 /5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3 0
  | /person 0
  |     /test1 2
  |  delegate=org.jboss.cache.pojo.impl.PojoCacheDelegate at 13043d2 types=0
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited pre fqn=/person/test1
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited post fqn=/person/test1
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited pre fqn=/__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited post fqn=/__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited pre fqn=/person/test1
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited post fqn=/person/test1
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited pre fqn=/__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3
  | 2007-05-09 22:03:33,921 TRACE [ReplicationDest] (Incoming Thread,192.168.0.112:1170) nodeVisited post fqn=/__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3
  | 2007-05-09 22:03:33,984 ERROR [TxInterceptor] (Incoming Thread,192.168.0.112:1170) method invocation failed
  | org.jboss.cache.pojo.PojoCacheException: PojoCacheDelegate.getObjectInternal(): null PojoInstance for fqn: /__JBossInternal__/person/test1/_ID_/5c4o034-mm6a9v-f1i7ypgq-1-f1i7ypo4-3
  | 	at org.jboss.cache.pojo.impl.PojoCacheDelegate.getObjectInternal(PojoCacheDelegate.java:338)
  | 	at org.jboss.cache.pojo.impl.PojoCacheDelegate.getObject(PojoCacheDelegate.java:106)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl.getObject(PojoCacheImpl.java:211)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$find$aop(PojoCacheImpl.java:200)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl$JoinPoint_find_N_7063709169143275953.dispatch(PojoCacheImpl$JoinPoint_find_N_7063709169143275953.java)
  | 	at org.jboss.cache.pojo.impl.JoinPoint_find_N_7063709169143275953_2.invokeNext(JoinPoint_find_N_7063709169143275953_2.java)
  | 	at org.jboss.cache.pojo.interceptors.CheckIdInterceptor.invoke(CheckIdInterceptor.java:32)
  | 	at org.jboss.cache.pojo.impl.JoinPoint_find_N_7063709169143275953_2.invokeNext(JoinPoint_find_N_7063709169143275953_2.java)
  | 	at org.jboss.cache.pojo.interceptors.PojoBeginInterceptor.invoke(PojoBeginInterceptor.java:54)
  | 	at org.jboss.cache.pojo.impl.JoinPoint_find_N_7063709169143275953_2.invokeNext(JoinPoint_find_N_7063709169143275953_2.java)
  | 	at org.jboss.cache.pojo.impl.JoinPoint_find_N_7063709169143275953_2.invokeJoinpoint(JoinPoint_find_N_7063709169143275953_2.java)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.find_N_7063709169143275953(PojoCacheImpl$PojoCacheImplAdvisor.java)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplInstanceAdvisor.find_N_7063709169143275953(PojoCacheImpl$PojoCacheImplInstanceAdvisor.java)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl.find(PojoCacheImpl.java)
  | 	at org.jboss.cache.pojo.impl.PojoCacheImpl.find(PojoCacheImpl.java:187)
  | 	at mailvision.ReplicationDest.nodeRemoved(ReplicationDest.java:150)
  | 	at org.jboss.cache.notifications.Notifier.notifyNodeRemoved(Notifier.java:233)
  | 	at org.jboss.cache.CacheImpl._remove(CacheImpl.java:2323)
  | 	at org.jboss.cache.CacheImpl._remove(CacheImpl.java:2257)
  | 	at org.jboss.cache.CacheImpl._remove(CacheImpl.java:2243)
  | 	at org.jboss.cache.CacheImpl._remove(CacheImpl.java:2237)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:330)
  | 	at org.jboss.cache.interceptors.CallInterceptor.invoke(CallInterceptor.java:49)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:33)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:202)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:34)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.NotificationInterceptor.invoke(NotificationInterceptor.java:22)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.TxInterceptor.replayModifications(TxInterceptor.java:497)
  | 	at org.jboss.cache.interceptors.TxInterceptor.handlePessimisticPrepare(TxInterceptor.java:391)
  | 	at org.jboss.cache.interceptors.TxInterceptor.handleRemotePrepare(TxInterceptor.java:249)
  | 	at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:97)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:168)
  | 	at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
  | 	at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:66)
  | 	at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3752)
  | 	at org.jboss.cache.CacheImpl._replicate(CacheImpl.java:2675)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:330)
  | 	at org.jboss.cache.marshall.InactiveRegionAwareRpcDispatcher.handle(InactiveRegionAwareRpcDispatcher.java:92)
  | 	at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:624)
  | 	at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:533)
  | 	at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:365)
  | 	at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:721)
  | 	at org.jgroups.JChannel.up(JChannel.java:1050)
  | 	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:326)
  | 	at org.jgroups.protocols.pbcast.FLUSH.up(FLUSH.java:509)
  | 	at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.up(STREAMING_STATE_TRANSFER.java:246)
  | 	at org.jgroups.protocols.FRAG2.up(FRAG2.java:197)
  | 	at org.jgroups.protocols.pbcast.GMS.up(GMS.java:717)
  | 	at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:226)
  | 	at org.jgroups.protocols.UNICAST.up(UNICAST.java:231)
  | 	at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:692)
  | 	at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:527)
  | 	at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:154)
  | 	at org.jgroups.protocols.FD.up(FD.java:328)
  | 	at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:301)
  | 	at org.jgroups.protocols.MERGE2.up(MERGE2.java:145)
  | 	at org.jgroups.protocols.Discovery.up(Discovery.java:224)
  | 	at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1541)
  | 	at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1495)
  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
  | 	at java.lang.Thread.run(Thread.java:595)


What do you think ?

Thanks in advance!

Lior Neuman 
R&D Team, 
MailVision LTD. 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044455#4044455

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044455



More information about the jboss-user mailing list