Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-1243

ClassCastException while accessing EnvironmentStats appearing frequently in debug logs

    Details

      Description

      The JE backend monitor is encountering a bug in recent versions of JE:

      [06/Dec/2013:13:57:23 +0100] 41 caught error thread={main(1)} method={addAttributesForStatsObject(DatabaseEnvironmentMon
      itor.java:205)} caught={java.lang.reflect.InvocationTargetException}
      Stack Trace:
        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.opends.server.monitors.DatabaseEnvironmentMonitor.addAttributesForStatsObject(DatabaseEnvironmentMonitor.java:1
      92)
        at org.opends.server.monitors.DatabaseEnvironmentMonitor.getMonitorData(DatabaseEnvironmentMonitor.java:248)
        at org.opends.server.monitors.DatabaseEnvironmentMonitor.getMonitorData(DatabaseEnvironmentMonitor.java:63)
        at org.opends.server.backends.MonitorBackend.getMonitorEntry(MonitorBackend.java:1160)
        at org.opends.server.backends.MonitorBackend.getEntry(MonitorBackend.java:1121)
        at org.opends.server.backends.MonitorBackend.search(MonitorBackend.java:782)
        at org.opends.server.authorization.dseecompat.AciListenerManager.performBackendInitializationProcessing(AciListenerMan
      ager.java:475)
        at org.opends.server.core.BackendConfigManager.initializeBackendConfig(BackendConfigManager.java:326)
        at org.opends.server.core.DirectoryServer.initializeBackends(DirectoryServer.java:2031)
        at org.opends.server.core.DirectoryServer.startServer(DirectoryServer.java:1397)
        at org.opends.server.util.EmbeddedUtils.startServer(EmbeddedUtils.java:88)
        at org.opends.server.TestCaseUtils.startServer(TestCaseUtils.java:489)
        at org.opends.server.TestCaseUtils.restartServer(TestCaseUtils.java:539)
        at org.opends.server.tools.ImportLDIFTestCase.setUp(ImportLDIFTestCase.java:78)
        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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:611)
        at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
        at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
        at org.testng.TestRunner.runWorkers(TestRunner.java:683)
        at org.testng.TestRunner.privateRun(TestRunner.java:560)
        at org.testng.TestRunner.run(TestRunner.java:456)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
        at org.testng.SuiteRunner.run(SuiteRunner.java:190)
        at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
        at org.testng.TestNG.run(TestNG.java:699)
        at org.testng.TestNG.privateMain(TestNG.java:824)
        at org.testng.TestNG.main(TestNG.java:802)
        at org.opends.server.SuiteRunner.main(SuiteRunner.java:39)
      Caused by: java.lang.ClassCastException: com.sleepycat.je.utilint.IntegralLongAvgStat cannot be cast to com.sleepycat.je.utilint.LongStat
        at com.sleepycat.je.utilint.StatGroup.getLong(StatGroup.java:207)
        at com.sleepycat.je.EnvironmentStats.getAvgBatchEvictorThread(EnvironmentStats.java:1332)
      

      In the method com.sleepycat.je.evictor.Evictor.loadStats(StatsConfig):

              for (EvictionSource source : allSources) {
                  int index = source.ordinal();
       
       
                  new IntegralLongAvgStat(copy,
                                          source.getAvgBatchStatDef(),
                                          numBatchTargets[index].get(),
                                          copy.getAtomicLong
                                              (source.getNumBatchesStatDef()));
                  if (config.getClear()) {
                      numBatchTargets[index].set(0);
                  }
       
       
              }
      

      But in the EnvironmentStats getters:

          public long getAvgBatchManual() {
              return cacheStats.getLong
                  (EvictionSource.MANUAL.getAvgBatchStatDef());
          }
      

      I've raised this JE bug on their forum.

        Attachments

          Activity

            People

            • Assignee:
              matthew Matthew Swift
              Reporter:
              matthew Matthew Swift
              Dev Assignee:
              Matthew Swift
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: