Sonar-cxx插件使SonarQube 5.6启动失败

时间:2018-03-02 08:26:59

标签: sonarqube sonarqube-ops

使用SQ 5.6.7和Sonar-cxx 0.9.8,SonarQube在提供RATS规则后无法启动。似乎无效XML中的规则存储在MySQL中。如何从MySQL中删除规则?

2018.03.02 12:50:02 INFO  web[o.s.s.r.RegisterRules] Register rules
2018.03.02 12:50:03 INFO  web[o.s.s.n.NotificationService] Notification service stopped
2018.03.02 12:50:03 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: XML is not valid
    at org.sonar.api.server.rule.RulesDefinitionXmlLoader.load(RulesDefinitionXmlLoader.java:233) ~[sonar-plugin-api-5.6.7.jar:na]
    at org.sonar.cxx.sensors.utils.CxxAbstractRuleRepository.define(CxxAbstractRuleRepository.java:99) ~[na:na]
    at org.sonar.server.rule.RuleDefinitionsLoader.load(RuleDefinitionsLoader.java:54) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.rule.RegisterRules.start(RegisterRules.java:97) ~[sonar-server-5.6.7.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320) ~[sonar-core-5.6.7.jar:na]
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored.start(Stored.java:110) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) ~[sonar-core-5.6.7.jar:na]
    at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:84) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.platformlevel.PlatformLevelStartup.access$001(PlatformLevelStartup.java:45) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:80) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:44) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:77) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:201) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.Platform.doStart(Platform.java:114) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.Platform.doStart(Platform.java:99) ~[sonar-server-5.6.7.jar:na]
    at org.sonar.server.platform.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:44) ~[sonar-server-5.6.7.jar:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.32.jar:8.0.32]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: com.ctc.wstx.exc.WstxParsingException: Undeclared general entity "randdesc"
 at [row,col {unknown-source}]: [250,29]
    at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:614) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:487) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.BasicStreamReader.handleUndeclaredEntity(BasicStreamReader.java:5470) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.StreamScanner.expandUnresolvedEntity(StreamScanner.java:1742) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.StreamScanner.expandEntity(StreamScanner.java:1626) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.StreamScanner.fullyResolveEntity(StreamScanner.java:1564) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2748) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1073) ~[woodstox-core-lgpl-4.4.0.jar:4.4.0]
    at org.codehaus.staxmate.in.SMHierarchicCursor.skipToEndElement(SMHierarchicCursor.java:156) ~[staxmate-2.0.1.jar:na]
    at org.codehaus.staxmate.in.SMHierarchicCursor.getNext(SMHierarchicCursor.java:103) ~[staxmate-2.0.1.jar:na]
    at org.sonar.api.server.rule.RulesDefinitionXmlLoader.load(RulesDefinitionXmlLoader.java:227) ~[sonar-plugin-api-5.6.7.jar:na]
    ... 36 common frames omitted
2018.03.02 12:50:03 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2018.03.02 12:50:03 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors

1 个答案:

答案 0 :(得分:0)

毕竟,我不得不重新构建MySQL以使SQ运行。原因是RATS规则被赋予' sonar.cxx.rats.reportPath'。但很明显,cxx pulgin从不检查它。