[jboss-user] [JBoss Cache] New message: "NPE in ClusteredCacheLoader (JBoss Cache 3.2.1.GA)"

Jamie S do-not-reply at jboss.com
Thu Jan 21 14:13:13 EST 2010


User development,

A new message was posted in the thread "NPE in ClusteredCacheLoader (JBoss Cache 3.2.1.GA)":

http://community.jboss.org/message/521550#521550

Author  : Jamie S
Profile : http://community.jboss.org/people/jamie.s

Message:
--------------------------------------------------------------
Hello,
 
Trying out a chained cacheloader configuration.
 
Previously, I had JDBCCacheLoader as the only loader, and that is working properly.
Now, I want to delegate to the cluster first, so I added ClusteredCacheLoader first.
 
However, when I start the first node in the cluster, and get to my first API call  (which is addChild() ), I hit an NPE in clustered cache loader:
 
java.lang.NullPointerException
    at org.jboss.cache.loader.ClusteredCacheLoader.exists(ClusteredCacheLoader.java:212)
 
Which I take to mean commandsFactory is null:
 
public boolean exists(Fqn name) throws Exception
   {
      // DON'T make a remote call if this is a remote call in the first place - leads to deadlocks - JBCACHE-1103
      if (!isCacheReady() || !cache.getInvocationContext().isOriginLocal()) return false;
 
      lock.acquireLock(name, false);
      try
      {
         ExistsCommand command = commandsFactory.buildExistsNodeCommand(name);
         Object resp = callRemote(command);
         return resp != null && (Boolean) resp;
      }
      finally
      {
         lock.releaseLock(name);
      }
   }
 
It would seem though, that isCacheReady returned true, and the invocationContext says it's a local call...
 
Here's my loader config:
 
<loaders passivation="false" shared="false">
        
        <loader
            class="org.jboss.cache.loader.ClusteredCacheLoader"
            async="false"
            ignoreModifications="true"
        >
            <properties>
                timeout=1500
            </properties>
        </loader>
        
        <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
        <loader
                class="org.jboss.cache.loader.JDBCCacheLoader"
                async="false"
                fetchPersistentState="true"
                ignoreModifications="false"
                purgeOnStartup="false">
            <properties>
                cache.jdbc.table.name=jbosscache
                cache.jdbc.table.create=true
                cache.jdbc.table.drop=false
                cache.jdbc.table.primarykey=jbosscache_pkey
                cache.jdbc.fqn.column=fqn
                cache.jdbc.fqn.type=VARCHAR(255)
                cache.jdbc.node.column=node
                cache.jdbc.node.type=bytea
                cache.jdbc.parent.column=parent
                cache.jdbc.driver=org.postgresql.Driver
                cache.jdbc.url=jdbc:postgresql:testdb
                cache.jdbc.user=+deleted+
                cache.jdbc.password=+deleted+
           </properties>
        </loader>
    </loaders>
 
And finally, the stack trace back to my call:
java.lang.NullPointerException
    at org.jboss.cache.loader.ClusteredCacheLoader.exists(ClusteredCacheLoader.java:212)
    at org.jboss.cache.loader.AbstractDelegatingCacheLoader.exists(AbstractDelegatingCacheLoader.java:94)
    at org.jboss.cache.loader.ChainingCacheLoader.exists(ChainingCacheLoader.java:128)
    at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:311)
    at org.jboss.cache.interceptors.CacheLoaderInterceptor.visitGetNodeCommand(CacheLoaderInterceptor.java:176)
    at org.jboss.cache.commands.read.GetNodeCommand.acceptVisitor(GetNodeCommand.java:76)
    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
    at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
    at org.jboss.cache.commands.AbstractVisitor.visitGetNodeCommand(AbstractVisitor.java:115)
    at org.jboss.cache.commands.read.GetNodeCommand.acceptVisitor(GetNodeCommand.java:76)
    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
    at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
    at org.jboss.cache.commands.AbstractVisitor.visitGetNodeCommand(AbstractVisitor.java:115)
    at org.jboss.cache.commands.read.GetNodeCommand.acceptVisitor(GetNodeCommand.java:76)
    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
    at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)
    at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:283)
    at org.jboss.cache.commands.AbstractVisitor.visitGetNodeCommand(AbstractVisitor.java:115)
    at org.jboss.cache.commands.read.GetNodeCommand.acceptVisitor(GetNodeCommand.java:76)
    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
    at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
    at org.jboss.cache.commands.AbstractVisitor.visitGetNodeCommand(AbstractVisitor.java:115)
    at org.jboss.cache.commands.read.GetNodeCommand.acceptVisitor(GetNodeCommand.java:76)
    at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
    at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
    at org.jboss.cache.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:130)
    at org.jboss.cache.commands.AbstractVisitor.visitGetNodeCommand(AbstractVisitor.java:115)
    at org.jboss.cache.commands.read.GetNodeCommand.acceptVisitor(GetNodeCommand.java:76)
    at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
    at org.jboss.cache.invocation.CacheInvocationDelegate.getNode(CacheInvocationDelegate.java:494)
    at org.jboss.cache.invocation.NodeInvocationDelegate.getChild(NodeInvocationDelegate.java:361)
    at org.jboss.cache.invocation.NodeInvocationDelegate.*addChild*(NodeInvocationDelegate.java:330)
    at com.whatever.configuration.initCache(configuration.java:134)
 
 
Anyone run into anything like this before?
I can't imagine it is the configuration of the ClusteredCacheLoader, that's pretty straight forward.
 
Thanks for any input,
 
Jamie

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/521550#521550




More information about the jboss-user mailing list