]> source.dussan.org Git - sonarqube.git/commitdiff
Fix warning at startup regarding JVmStateSection
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 16 Oct 2017 10:01:26 +0000 (12:01 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 16 Oct 2017 11:57:02 +0000 (13:57 +0200)
Two same instances of JvmStateSection are defined in pico. It generates
the warning log:
"WARN  ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.process.systeminfo.JvmStateSection@13078cb2. Please implement toString() method on class org.sonar.process.systeminfo.JvmStateSection"

server/sonar-ce/src/main/java/org/sonar/ce/CeConfigurationModule.java
server/sonar-ce/src/main/java/org/sonar/ce/CeQueueModule.java
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java

index e239b685e16083f6ded195a01862719b983f280b..1f45caebe848cf7c602c877d3652ed25a95fb747 100644 (file)
@@ -21,9 +21,11 @@ package org.sonar.ce;
 
 import org.sonar.ce.configuration.CeConfigurationImpl;
 import org.sonar.ce.log.CeLogging;
+import org.sonar.ce.monitoring.CeDatabaseMBeanImpl;
 import org.sonar.core.platform.Module;
+import org.sonar.process.systeminfo.JvmPropertiesSection;
 import org.sonar.process.systeminfo.JvmStateSection;
-import org.sonar.ce.monitoring.CeDatabaseMBeanImpl;
+import org.sonar.server.platform.monitoring.cluster.LoggingSection;
 
 public class CeConfigurationModule extends Module {
   @Override
@@ -32,6 +34,8 @@ public class CeConfigurationModule extends Module {
       CeConfigurationImpl.class,
       CeLogging.class,
       CeDatabaseMBeanImpl.class,
-      new JvmStateSection("Compute Engine JVM State"));
+      new JvmStateSection("Compute Engine JVM State"),
+      new JvmPropertiesSection("Compute Engine JVM Properties"),
+      LoggingSection.class);
   }
 }
index f1776dd8c7805c36969c18ad2784e8ebe00f4b92..a34c2d774115fbab4c6ef45f1843b13048798288 100644 (file)
@@ -24,9 +24,6 @@ import org.sonar.ce.monitoring.CeTasksMBeanImpl;
 import org.sonar.ce.queue.CeQueueInitializer;
 import org.sonar.ce.queue.InternalCeQueueImpl;
 import org.sonar.core.platform.Module;
-import org.sonar.process.systeminfo.JvmPropertiesSection;
-import org.sonar.process.systeminfo.JvmStateSection;
-import org.sonar.server.platform.monitoring.cluster.LoggingSection;
 
 public class CeQueueModule extends Module {
   @Override
@@ -38,9 +35,6 @@ public class CeQueueModule extends Module {
       // queue monitoring
       CEQueueStatusImpl.class,
       CeTasksMBeanImpl.class,
-      new JvmStateSection("Compute Engine JVM State"),
-      new JvmPropertiesSection("Compute Engine JVM Properties"),
-      LoggingSection.class,
 
       // init queue state and queue processing
       CeQueueInitializer.class);
index 3a6b1a74cf24f45a7cd9876ba7deb0ebd63681c1..b080ec9da78fc146a5933983dea1fab494d88cf3 100644 (file)
@@ -130,8 +130,8 @@ public class ComputeEngineContainerImplTest {
       .hasSize(
         CONTAINER_ITSELF
           + 75 // level 4
-          + 4 // content of CeConfigurationModule
-          + 7 // content of CeQueueModule
+          + 6 // content of CeConfigurationModule
+          + 4 // content of CeQueueModule
           + 4 // content of CeHttpModule
           + 3 // content of CeTaskCommonsModule
           + 4 // content of ProjectAnalysisTaskModule