我知道这与SonarQube background tasks failing with IllegalArgumentException for Java非常相似,但就我而言,我不知道问题究竟发生在哪里。 这是我的日志:
2016.02.03 13:24:22 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVKnFyTzP-Q7QH-_7ITt
java.lang.IllegalArgumentException: Multiple entries with same key: scala=Scala and scala=Scala
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150) ~[guava-17.0.jar:na]
at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104) ~[guava-17.0.jar:na]
at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70) ~[guava-17.0.jar:na]
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254) ~[guava-17.0.jar:na]
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166) ~[guava-17.0.jar:na]
at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140) ~[guava-17.0.jar:na]
at org.sonar.server.computation.language.LanguageRepositoryImpl.<init>(LanguageRepositoryImpl.java:46) ~[sonar-server-5.3.jar:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_72-internal]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_72-internal]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_72-internal]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_72-internal]
at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632) ~[picocontainer-2.15.jar:na]
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118) ~[picocontainer-2.15.jar:na]
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) ~[picocontainer-2.15.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) ~[picocontainer-2.15.jar:na]
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) ~[picocontainer-2.15.jar:na]
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678) ~[picocontainer-2.15.jar:na]
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:262) ~[sonar-core-5.3.jar:na]
at org.sonar.server.computation.step.AbstractComputationSteps$1.apply(AbstractComputationSteps.java:43) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.step.AbstractComputationSteps$1.apply(AbstractComputationSteps.java:40) ~[sonar-server-5.3.jar:na]
at com.google.common.collect.Iterators$8.transform(Iterators.java:794) ~[guava-17.0.jar:na]
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[guava-17.0.jar:na]
at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:37) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:72) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-5.3.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_72-internal]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_72-internal]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_72-internal]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_72-internal]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_72-internal]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72-internal]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72-internal]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72-internal]
2016.02.03 13:24:22 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=org.codehaus.sonar:javascript-sonar-runner-lcov:iss-hipcms-269 | id=AVKnFyTzP-Q7QH-_7ITt | time=3823ms
问题是我只能看到java.lang.IllegalArgumentException: Multiple entries with same key: scala=Scala and scala=Scala
,所以我不确定问题出在哪里。
之前已经有一个项目,我使用了相同的属性。这个问题是否可能发生,因为我为它们设置了sonar.projectKey=org.codehaus.sonar:javascript-sonar-runner-lcov
?或者这不是错误消息所指的那个键?如果是,那么我应该把它作为sonar.projectKey
?
答案 0 :(得分:3)
你正在使用2个插件(scalastyle和scoverage)向SonarQube声明完全相同的语言(scala)。这不是插件应该如何表现的:应该有一个插件声明语言(理想地命名为“sonar-scala-plugin”)和其他引用该语言的插件(但不是声明它)。
一旦这些插件的开发人员对哪个插件声明了该语言以及哪个插件引用了该插件,就应该解决您的问题。
答案 1 :(得分:1)
我有同样的问题,我做的是以下内容:
然后我重构了代码,在sonarplugin扩展的类中,我删除了定义语言的类: 我的ScalastylePlugin看起来如下:
覆盖def getExtensions:java.util.List [Class [_&lt ;: Extension]] = ListBuffer( classOf [ScalastyleRepository] classOf [ScalastyleQualityProfile] classOf [ScalastyleSensor] )
我为声纳scoverage插件做了同样的事情。在扩展SonarPlugin的类中,我删除了classOf [Scala];
然后我构建了所有插件并将插件jar文件添加到sonarqube。