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

Possible NPE when shutting down RepositoryChangeBus in ModeShape 3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.8.x-prod-ip6.1
    • 3.8.x-prod-ip6.1
    • None
    • None

      With the latest RepositoryChangeBus cleanup code, the current code incorrectly nulls out the queue when shutting down the bus. This can
      produce exceptions like:

      17:42:20,766 ERROR Error killing repository "testRepo": java.lang.NullPointerException
      java.util.concurrent.ExecutionException: java.lang.NullPointerException
              at java.util.concurrent.FutureTask.report(FutureTask.java:122)
              at java.util.concurrent.FutureTask.get(FutureTask.java:188)
              at org.modeshape.jcr.TestingUtil.killRepository(TestingUtil.java:97)
              at org.modeshape.jcr.TestingUtil.killRepositories(TestingUtil.java:72)
              at org.modeshape.jcr.TestingUtil.killRepositories(TestingUtil.java:56)
              at org.modeshape.jcr.SingleUseAbstractTest.stopRepository(SingleUseAbstractTest.java:90)
              at org.modeshape.jcr.SingleUseAbstractTest.afterEach(SingleUseAbstractTest.java:111)
              at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
              at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
              at org.junit.rules.RunRules.evaluate(RunRules.java:20)
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
              at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
              at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
              at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
              at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
              at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
              at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
      Caused by: java.lang.NullPointerException
              at org.modeshape.jcr.bus.RepositoryChangeBus$ChangeSetDispatcher.submit(RepositoryChangeBus.java:213)
              at org.modeshape.jcr.bus.RepositoryChangeBus.shutdown(RepositoryChangeBus.java:92)
              at org.modeshape.jcr.JcrRepository$RunningState.shutdown(JcrRepository.java:1643)
              at org.modeshape.jcr.JcrRepository.doShutdown(JcrRepository.java:434)
              at org.modeshape.jcr.JcrRepository$1.call(JcrRepository.java:343)
              at org.modeshape.jcr.JcrRepository$1.call(JcrRepository.java:340)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              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:724)
      

      We should make sure this doesn't happen.

              hchiorean Horia Chiorean (Inactive)
              hchiorean Horia Chiorean (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: