4 Replies Latest reply on Mar 7, 2013 1:30 PM by Vitaliy Sergeev

    Newbie question

    Vitaliy Sergeev Newbie

      Hello, i'm trying to reproduce simple example given at https://github.com/ModeShape/modeshape-examples/tree/master/modeshape-filesystem-store-example

      as Java SE application

       

       

      First exception was

      javax.jcr.RepositoryException: Error while starting 'Persisted-Repository' repository: org.infinispan.CacheConfigurationException: Unable to instantiate class org.infinispan.loaders.bdbje.BdbjeCacheStore

      .....

      etc.

       

       

      So i removed the string  "cacheConfiguration" : "infinispan-configuration.xml",   from conf file "my-repository-config.json".

      After that everything goes fine

      + Root childs

      +---> jcr:system

      +---> Node2077192100

      Shutting down engine ...

      Success!

       

       

      I found local files - they exists

      Ok, application exited.

       

       

      Start again, i thought that second run will save another file to the storage, yes, he saved... as another file in the filesystem, but i can't access prev. file (node).

       

       

      // Get the root node ...

      Node root = session.getRootNode();

      assert root != null;

       

      Node nd = root.getNode("Node2077192100");

                 

      System.out.println("Found the root node in the \"" + session.getWorkspace().getName() + "\" workspace");

       

       

      this code modification returns with

      javax.jcr.PathNotFoundException: The child "Node2077192100" could not be found under "/" in workspace "default"

       

       

      is i misunderstood something?

        • 1. Re: Newbie question
          Randall Hauch Master

          You need to configure Infinispan cache with some cache store, otherwise upon restart you will lose all of your content.** That example already includes a cache store that writes to a local instance of BerkleyDB Java Edition.

           

          How are you building? Can you build all of the examples using "mvn clean install -s settings.xml"? If not, what errors do you get? Also, can you post more of the stack trace you're getting?

           

           

           

          ** Technically, a cache store is only required for local topologies and small clusters, like with the example. You can create larger clusters that don't use a cache store but instead rely upon some portion of your cluster always remaining accessible. See our clustering documentation for details.)

          • 2. Re: Newbie question
            Vitaliy Sergeev Newbie

            i'm don't familiar with maven, i've used eclipse to compile.

             

            I've installed maven, build was successful with "mvn clean install -s settings.xml"

             

            In eclipse

            javax.jcr.RepositoryException: Error while starting 'Persisted-Repository' repository: org.infinispan.CacheConfigurationException: Unable to instantiate class org.infinispan.loaders.bdbje.BdbjeCacheStore

                      at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:619)

                      at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:586)

                      at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:155)

                      at org.modeshape.example.filesystem.ModeShapeExample.main(ModeShapeExample.java:55)

            Caused by: org.infinispan.config.ConfigurationException: org.infinispan.CacheConfigurationException: Unable to instantiate class org.infinispan.loaders.bdbje.BdbjeCacheStore

                      at org.infinispan.configuration.parsing.Parser.parse(Parser.java:116)

                      at org.infinispan.configuration.parsing.Parser.parse(Parser.java:94)

                      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:369)

                      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:341)

                      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:328)

                      at org.modeshape.jcr.LocalEnvironment.createContainer(LocalEnvironment.java:201)

                      at org.modeshape.jcr.LocalEnvironment.getCacheContainer(LocalEnvironment.java:113)

                      at org.modeshape.jcr.RepositoryConfiguration.getCacheContainer(RepositoryConfiguration.java:983)

                      at org.modeshape.jcr.RepositoryConfiguration.getContentCacheContainer(RepositoryConfiguration.java:973)

                      at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1045)

                      at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:961)

                      at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:360)

                      at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:617)

                      ... 3 more

            Caused by: org.infinispan.CacheConfigurationException: Unable to instantiate class org.infinispan.loaders.bdbje.BdbjeCacheStore

                      at org.infinispan.util.Util.loadClass(Util.java:88)

                      at org.infinispan.util.Util.getInstance(Util.java:206)

                      at org.infinispan.configuration.parsing.Parser.parseLoader(Parser.java:461)

                      at org.infinispan.configuration.parsing.Parser.parseLoaders(Parser.java:439)

                      at org.infinispan.configuration.parsing.Parser.parseCache(Parser.java:210)

                      at org.infinispan.configuration.parsing.Parser.parseNamedCache(Parser.java:169)

                      at org.infinispan.configuration.parsing.Parser.doParse(Parser.java:140)

                      at org.infinispan.configuration.parsing.Parser.parse(Parser.java:105)

                      ... 15 more

            Caused by: java.lang.ClassNotFoundException: org.infinispan.loaders.bdbje.BdbjeCacheStore

                      at org.infinispan.util.Util.loadClassStrict(Util.java:136)

                      at org.infinispan.util.Util.loadClass(Util.java:86)

                      ... 22 more

            Caused by: java.lang.NoClassDefFoundError: com/sleepycat/collections/TransactionWorker

                      at java.lang.Class.forName0(Native Method)

                      at java.lang.Class.forName(Unknown Source)

                      at org.infinispan.util.Util.loadClassStrict(Util.java:125)

                      ... 23 more

            Caused by: java.lang.ClassNotFoundException: com.sleepycat.collections.TransactionWorker

                      at java.net.URLClassLoader$1.run(Unknown Source)

                      at java.net.URLClassLoader$1.run(Unknown Source)

                      at java.security.AccessController.doPrivileged(Native Method)

                      at java.net.URLClassLoader.findClass(Unknown Source)

                      at java.lang.ClassLoader.loadClass(Unknown Source)

                      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

                      at java.lang.ClassLoader.loadClass(Unknown Source)

            • 3. Re: Newbie question
              Randall Hauch Master

              Okay, so the build actually works, just not in Eclipse. That's probably becuase Eclipse doesn't know it's a Maven project. Make sure you have the M2Eclipse plugin that adds Maven support into your IDE. Then, remove and then re-import the project as a Maven project by selecting "File->Import" and in the dialog expand the "Maven" section and select the "Existing Maven Projets" importer, select "Next" and set the "Root Directory" to the folder containing all the examples. After you select the "Root Directory", the "Projects" area will list all of the examples plus a top-level "pom.xml". Be sure to deselect the top-level "pom.xml" and select all the others, and press "Finish".

               

              See the documentation on how to use the Maven importer.

              1 of 1 people found this helpful
              • 4. Re: Newbie question
                Vitaliy Sergeev Newbie

                this helps me alot, thank you very much!