5

在使用声纳运行分析源代码时,我得到 PicoLifecycleException 以下是堆栈跟踪,

org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.components.EmbedderPhases.start()', instance 'org.sonar.batch.components.EmbedderPhases@1f4e9be, java.lang.RuntimeException: wrapper
    at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132)
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115)
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
    at org.picocontainer.behaviors.Stored.start(Stored.java:110)
    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:996)
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:989)
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:746)
    at org.sonar.batch.Module.start(Module.java:88)
    at org.sonar.batch.SonarEclipseRuntime.analyse(SonarEclipseRuntime.java:44)
    at org.sonar.ide.eclipse.core.jobs.AnalyseProjectJob.run(AnalyseProjectJob.java:107)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.RuntimeException: wrapper
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
    ... 13 more
Caused by: org.sonar.api.utils.SonarException: Can not execute Checkstyle
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:87)
    at org.sonar.plugins.checkstyle.CheckstyleSensor.analyse(CheckstyleSensor.java:43)
    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:58)
    at org.sonar.batch.components.EmbedderPhases.start(EmbedderPhases.java:64)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
    ... 12 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module Header - property 'headerFile' is missing or invalid in module Header
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:177)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:207)
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:81)
    ... 20 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: property 'headerFile' is missing or invalid in module Header
    at com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck.finishLocalSetup(AbstractHeaderCheck.java:192)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:203)
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:156)
    ... 22 more
4

1 回答 1

6

根据您的堆栈跟踪 - 底层错误来自 Checkstyle “模块 Header 中的属性 'headerFile' 丢失或无效”。这意味着您在没有指定此规则参数的情况下激活了 Checkstyle 规则“标题”。

于 2012-08-04T07:45:16.357 回答