4 Replies Latest reply: Mar 7, 2012 4:23 AM by Galder Zamarreño RSS

NPE when unmarshalling values from FileStoreCache

Helga Waage Newbie

I am currently migrating an application from jBoss 4.2.3. to jBoss 7.1.  As part of the process I am integrating Infinispan as cache.  The behaviour I need is a persistent local cache. 

 

The configuration that I have for the cache is

 

        org.infinispan.configuration.cache.Configuration config =new ConfigurationBuilder()
                .eviction()
                     .maxEntries(20000).strategy(EvictionStrategy.LIRS)
                     .expiration()
                     .wakeUpInterval(5000L)
                     .lifespan(3600000L)
                     .maxIdle(-1L)
                .jmxStatistics().enable()
                .storeAsBinary().enable().storeKeysAsBinary(false).storeValuesAsBinary(true)
                .loaders()
                    .shared(false).passivation(false).preload(true)
                    .addFileCacheStore().location("/usr/local/jboss/standalone/cache")
                    .fetchPersistentState(true).purgeOnStartup(false).ignoreModifications(false)
                .build();

 

When the cache is empty, the server starts up fine, but whenever the cache should reload existing cache entries from the filestore, it crashes with this exception

 

ISPN000136: Execution error: org.infinispan.CacheException: Unable to unmarshall value

 

The cause of the error is this: 

 

Caused by: java.lang.NullPointerException

    at org.infinispan.marshall.MarshalledValue.deserialize0(MarshalledValue.java:154) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    ... 51 more

 

i.e. the marshaller itself is null. 

 

None of the values in the cache are null and all of the cachable items are serializable. 

 

If I reduce the number of entries to something very small (to force eviction to disk and subsequent re-loads), the same thing happens, so this is not just a problem in startup.

 

I am also using hibernate as second-level cache in the entity layer and that works fine, but that does not use the file cache.

 

Any ideas?  Is the configuration incorrect?

 

Below is full stack trace:

 

12:46:48,904 ERROR [org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:141)] (ajp--127.0.0.1-8009-1) ISPN000136: Execution error: org.infinispan.CacheException: Unable to unmarshall value

    at org.infinispan.marshall.MarshalledValue.deserialize0(MarshalledValue.java:159) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.marshall.MarshalledValue.deserialize(MarshalledValue.java:143) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.marshall.MarshalledValue.get(MarshalledValue.java:224) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.MarshalledValueInterceptor.visitEntrySetCommand(MarshalledValueInterceptor.java:256) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.read.EntrySetCommand.acceptVisitor(EntrySetCommand.java:60) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.AbstractVisitor.visitEntrySetCommand(AbstractVisitor.java:107) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.read.EntrySetCommand.acceptVisitor(EntrySetCommand.java:60) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.AbstractVisitor.visitEntrySetCommand(AbstractVisitor.java:107) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.read.EntrySetCommand.acceptVisitor(EntrySetCommand.java:60) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:130) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:89) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.AbstractVisitor.visitEntrySetCommand(AbstractVisitor.java:107) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.commands.read.EntrySetCommand.acceptVisitor(EntrySetCommand.java:60) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.CacheImpl.entrySet(CacheImpl.java:327) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at org.infinispan.CacheImpl.entrySet(CacheImpl.java:320) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    at com.myapp.util.cache.CacheAdministrator.getStatus(CacheAdministrator.java:140) [CacheUtil.jar:]

    at com.myapp.util.cache.CacheAdministrator.getStatus(CacheAdministrator.java:96) [CacheUtil.jar:]

    at is.hex.ticket.action.pages.TicketmasterEvents.EventsListAction.execute(EventsListAction.java:1606) [classes:]

    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) [struts.jar:1.2.9]

    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) [struts.jar:1.2.9]

    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) [struts.jar:1.2.9]

    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) [struts.jar:1.2.9]

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

    at com.myapp.util.web.filter.RequestFilter.doFilter(RequestFilter.java:71) [WebUtils.jar:]

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

    at com.myapp.util.web.filter.TimeMeasurementFilter.doFilter(TimeMeasurementFilter.java:51) [WebUtils.jar:]

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]

    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]

    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.10.Final.jar:]

    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb-7.0.10.Final.jar:]

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

    at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_29]

Caused by: java.lang.NullPointerException

    at org.infinispan.marshall.MarshalledValue.deserialize0(MarshalledValue.java:154) [infinispan-core-5.1.1.FINAL.jar:5.1.1.FINAL]

    ... 49 more