Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2071

javax.jcr.RepositoryException: Error while starting 'KRepository' repository: null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 3.6.0.Final
    • 3.5.0.Final
    • JCR
    • None
    • Hide
      engine.start();
      RepositoryConfiguration config = RepositoryConfiguration.read(repositoryPath.getPath());
      engine.deploy(config);
      javax.jcr.Repository repository = engine.getRepository("KRepository");
      repository.login(); // exception!!!
      

      =====================================

      {
        "name": "KRepository",
        "transactionMode": "auto",
        "monitoring": {
          "enabled": true,
        },
        "workspaces": {
          "predefined": ["otherWorkspace"],
          "default": "k_wsp",
          "allowCreation": true
        },
        "security": {
          "anonymous": {
            "roles": ["readonly", "readwrite", "admin"],
            "useOnFailedLogin": false
          }
        },
        "storage": {
          "cacheName": "KRepository",
          "cacheConfiguration": "/home/kRep/infinispan_configuration.xml",
          "binaryStorage": {
            "type": "file",
            "directory": "/home/KStorage",
            "minimumBinarySizeInBytes": 4096
          }
        }
      }
      

      ====================================================

      <infinispan
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
             xmlns="urn:infinispan:config:5.2">
          <global>
             <globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
          </global>
       
          <default>
             <!--
               Defines the default behavior for all caches, including those created dynamically (e.g., when a
               repository uses a cache that doesn't exist in this configuration).
             -->
          </default>
       
          <namedCache name="KRepository">
             <!--
                Our Infinispan cache needs to be transactional. However, we'll also configure it to
                use pessimistic locking, which is required whenever applications will be concurrently
                updating nodes within the same process. If you're not sure, use pessimistic locking.
             -->
             <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
                          transactionMode="TRANSACTIONAL"
                          lockingMode="PESSIMISTIC"/>
             <!--
                Define the cache loaders (i.e., cache stores). Passivation is false because we want *all*
                data to be persisted, not just what doesn't fit into memory. Shared is false because there
                are no other caches sharing this file store. We set preload to false for lazy loading;
                may be improved by preloading and configuring eviction.
       
                We can have multiple cache loaders, which get chained. But we'll define just one.
             -->
             <loaders passivation="false" shared="false" preload="false">
       
                <!--
                  The 'fetchPersistentState' attribute applies when this cache joins the cluster; the value doesn't
                  really matter to us in this case. See the documentation for more options.
                -->
                <loader class="org.infinispan.loaders.file.FileCacheStore"
                        fetchPersistentState="false"
                        purgeOnStartup="false">
                   <!-- See the documentation for more configuration examples and flags. -->
                   <properties>
                      <!-- We have to set the location where we want to store the data. -->
                      <property name="location" value="/home/KStorage"/>
                   </properties>
                   <!-- This repository isn't clustered, so we could set up the SingletonStore.
                   singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000"/>
                   -->
                   <!--
                     We could use "write-behind", which actually writes to the file system asynchronously,
                     which can improve performance as seen by the JCR client.
                     Plus changes are coalesced, meaning that if multiple changes are enqueued for the
                     same node, only the last one is written. (This is good much of the time, but not
                     always.)
                   <async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>
                   -->
                </loader>
             </loaders>
          </namedCache>
      </infinispan>
      
      Show
      engine.start(); RepositoryConfiguration config = RepositoryConfiguration.read(repositoryPath.getPath()); engine.deploy(config); javax.jcr.Repository repository = engine.getRepository( "KRepository" ); repository.login(); // exception!!! ===================================== { "name" : "KRepository" , "transactionMode" : "auto" , "monitoring" : { "enabled" : true , }, "workspaces" : { "predefined" : [ "otherWorkspace" ], " default " : "k_wsp" , "allowCreation" : true }, "security" : { "anonymous" : { "roles" : [ "readonly" , "readwrite" , "admin" ], "useOnFailedLogin" : false } }, "storage" : { "cacheName" : "KRepository" , "cacheConfiguration" : "/home/kRep/infinispan_configuration.xml" , "binaryStorage" : { "type" : "file" , "directory" : "/home/KStorage" , "minimumBinarySizeInBytes" : 4096 } } } ==================================================== <infinispan xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "urn:infinispan:config:5.1 http: //www.infinispan.org/schemas/infinispan-config-5.1.xsd" xmlns= "urn:infinispan:config:5.2" > <global> <globalJmxStatistics enabled= " false " allowDuplicateDomains= " true " /> </global> < default > <!-- Defines the default behavior for all caches, including those created dynamically (e.g., when a repository uses a cache that doesn't exist in this configuration). --> </ default > <namedCache name= "KRepository" > <!-- Our Infinispan cache needs to be transactional. However, we'll also configure it to use pessimistic locking, which is required whenever applications will be concurrently updating nodes within the same process. If you're not sure, use pessimistic locking. --> <transaction transactionManagerLookupClass= "org.infinispan.transaction.lookup.GenericTransactionManagerLookup" transactionMode= "TRANSACTIONAL" lockingMode= "PESSIMISTIC" /> <!-- Define the cache loaders (i.e., cache stores). Passivation is false because we want *all* data to be persisted, not just what doesn't fit into memory. Shared is false because there are no other caches sharing this file store. We set preload to false for lazy loading; may be improved by preloading and configuring eviction. We can have multiple cache loaders, which get chained. But we'll define just one. --> <loaders passivation= " false " shared= " false " preload= " false " > <!-- The 'fetchPersistentState' attribute applies when this cache joins the cluster; the value doesn't really matter to us in this case . See the documentation for more options. --> <loader class= "org.infinispan.loaders.file.FileCacheStore" fetchPersistentState= " false " purgeOnStartup= " false " > <!-- See the documentation for more configuration examples and flags. --> <properties> <!-- We have to set the location where we want to store the data. --> <property name= "location" value= "/home/KStorage" /> </properties> <!-- This repository isn't clustered, so we could set up the SingletonStore. singletonStore enabled= " true " pushStateWhenCoordinator= " true " pushStateTimeout= "20000" /> --> <!-- We could use "write-behind" , which actually writes to the file system asynchronously, which can improve performance as seen by the JCR client. Plus changes are coalesced, meaning that if multiple changes are enqueued for the same node, only the last one is written. (This is good much of the time, but not always.) <async enabled= " true " flushLockTimeout= "15000" threadPoolSize= "5" /> --> </loader> </loaders> </namedCache> </infinispan>

    Description

      My Code is working fine with 3.2 and 3.1 but it is not working with 3.5

      javax.jcr.RepositoryException: Error while starting 'KRepository' repository: null
      	at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:607	at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:607)
      )
      	at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:576	at org.modeshape.jcr.JcrRepository.login()
      JcrRepository.java:576)
      	at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:155	at org.modeshape.jcr.JcrRepository.login()
      JcrRepository.java:155)
      	at UserJUnitTest.printNode(UserJUnitTest.java:83	at UserJUnitTest.printNode()
      UserJUnitTest.java:83)
      	at UserJUnitTest.hello(UserJUnitTest.java:72	at UserJUnitTest.hello()
      UserJUnitTest.java:72)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      	at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
      	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520)
      	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
      	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)
      Caused by: java.lang.NullPointerException
      	at org.modeshape.jcr.cache.RepositoryCache.refreshRepositoryMetadata(RepositoryCache.java:443)
      	at org.modeshape.jcr.cache.RepositoryCache.<init>(RepositoryCache.java:229)
      	at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1063)
      	at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:928)
      	at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:361)
      	at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:605)
      	... 29 more
      

      Attachments

        Activity

          People

            rhauch Randall Hauch (Inactive)
            greenday_ra Reza Azizi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: