Nullpointer exception in 3.0.0.Alpha4 example
neil.zou May 25, 2012 4:51 AMHi All,
I'm trying to store modeshape cache to file system, after I did some change in the configuration files (in the modeshape-embedded-repo-demo example). I got below errors:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. May 25, 2012 4:37:55 PM org.infinispan.factories.GlobalComponentRegistry start INFO: ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.2.FINAL javax.jcr.RepositoryException: Error while starting 'My Repository' repository: java.lang.NullPointerException at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:566) at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:533) at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:138) at org.modeshape.demo.embedded.repo.EmbeddedRepositoryDemo.main(EmbeddedRepositoryDemo.java:53) Caused by: java.lang.RuntimeException: java.lang.NullPointerException at org.modeshape.jcr.JcrRepository$RepositorySessionEnvironment.currentTransaction(JcrRepository.java:1531) at org.modeshape.jcr.JcrRepository$RepositorySessionEnvironment.createMonitor(JcrRepository.java:1537) at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:330) at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:294) at org.modeshape.jcr.cache.RepositoryCache.<init>(RepositoryCache.java:128) at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1004) at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:901) at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:337) at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:564) ... 3 more Caused by: java.lang.NullPointerException at org.modeshape.jcr.JcrRepository$RepositorySessionEnvironment.currentTransaction(JcrRepository.java:1529) ... 11 more Shutting down engine ... Success!
Below is my configuration:
{ "name" : "My Repository", "workspaces" : { "default" : "default", "predefined" : ["otherWorkspace"], "allowCreation" : true }, "storage" : { "cacheConfiguration" : "/Code/modeshape3/resources/infinispan.xml", "cacheName" : "filestore", "transactionManagerLookup" = "org.infinispan.transaction.lookup.GenericTransactionManagerLookup", "binaryStorage" : { "minimumBinarySizeInBytes" : 4096, "type" = "file", "directory" = "/dev/infini_cache" } }, "security" : { "anonymous" : { "roles" : ["readonly","readwrite","admin"], "useOnFailedLogin" : false } } }
And added below infinispan config xml:
<?xml version="1.0" encoding="UTF-8"?> <infinispan xmlns="urn:infinispan:config:5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://docs.jboss.org/infinispan/schemas/infinispan-config-5.1.xsd"> <global/> <namedCache name="filestore"> <eviction maxEntries="1000" /> <loaders passivation="false" shared="false" preload="true"> <!-- We can have multiple cache loaders, which get chained --> <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true" purgerThreads="3" purgeSynchronously="true" ignoreModifications="false" purgeOnStartup="false"> <!-- See the documentation for more configuration examples and flags. --> <properties> <property name="location" value="/dev/infini_cache" /> </properties> <singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000" /> <async enabled="false" flushLockTimeout="15000" threadPoolSize="5" /> </loader> </loaders> </namedCache> </infinispan>
Could anyone help to figure out what's wrong here?
Thanks!