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

NullPointerException in background garbage collection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Blocker
    • 3.2.0.Final
    • 3.2.0.Final
    • JCR
    • None
    • Hide

      See attached test case. On a Macbook Pro with JDK 1.7 it usually takes around 5 minutes for the error to occur.

      Show
      See attached test case. On a Macbook Pro with JDK 1.7 it usually takes around 5 minutes for the error to occur.

    Description

      I get the following exception after the attached test case has run for a while.

      14:55:09,677 ERROR JcrRepository:175 - Error during background garbage collection: null
      java.lang.NullPointerException
      	at org.modeshape.jcr.SystemContent.systemKey(SystemContent.java:127)
      	at org.modeshape.jcr.SystemContent.systemNode(SystemContent.java:174)
      	at org.modeshape.jcr.SystemContent.locksKey(SystemContent.java:156)
      	at org.modeshape.jcr.SystemContent.mutableLocksNode(SystemContent.java:202)
      	at org.modeshape.jcr.SystemContent.cleanUpLocks(SystemContent.java:796)
      	at org.modeshape.jcr.JcrRepository$RunningState.cleanUpLocks(JcrRepository.java:1675)
      	at org.modeshape.jcr.JcrRepository$LockGarbageCollectionTask.doRun(JcrRepository.java:2001)
      	at org.modeshape.jcr.JcrRepository$GarbageCollectionTask.run(JcrRepository.java:1971)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:722)
      

      Attaching a debugger and catching the error shows that the value of system.getNode(system.getRootKey()) is returning a null.

          public NodeKey systemKey() {
              if (systemKey == null) {
                  // This is idempotent, so no need to lock
                  CachedNode rootNode = system.getNode(system.getRootKey());
                  ChildReference systemRef = rootNode.getChildReferences(system).getChild(JcrLexicon.SYSTEM);
                  systemKey = systemRef.getKey();
              }
              return systemKey;
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bwallis42_jira Brian Wallis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: