由于嵌入式错误:任何主机配置,在声纳分析期间不会生成Pdf报告

时间:2016-02-04 06:39:33

标签: maven jenkins sonarqube sonarqube-4.5


今天我突然遇到一个新的错误,如下所示。生成pdf报告时出现此错误。
这里生成了声纳仪表板,但没有生成pdf报告,由于以下错误,Jenkins的构建失败。
我正在使用Sonarqube 4.5.1,maven 2.2.1,sonar-maven-plugin-1.0,jdk 1.7。

 ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/sonar/dashboard/index/com.web:webnet:test
[INFO] [06:55:09.248] Executing post-job class org.sonar.report.pdf.batch.PDFPostJob
[INFO] [06:55:09.249] Executing decorator: PDF Report
[INFO] [06:55:09.253] Team executive report type selected
[ERROR] ANY_HOST_CONFIGURATION
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar

Embedded error: ANY_HOST_CONFIGURATION
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:204)
at hudson.maven.MavenBuilder.call(MavenBuilder.java:154)
at hudson.maven.Maven2Builder.call(Maven2Builder.java:79)
at hudson.maven.Maven2Builder.call(Maven2Builder.java:55)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:324)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 27 more
Caused by: org.apache.maven.plugin.MojoExecutionException: ANY_HOST_CONFIGURATION
at org.sonar.maven.ExceptionHandling.handle(ExceptionHandling.java:37)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:175)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
... 32 more
Caused by: java.lang.NoSuchFieldError: ANY_HOST_CONFIGURATION
at org.apache.commons.httpclient.params.HttpConnectionManagerParams.setDefaultMaxConnectionsPerHost(HttpConnectionManagerParams.java:86)
at org.sonar.wsclient.connectors.HttpClient3Connector.createClient(HttpClient3Connector.java:56)
at org.sonar.wsclient.connectors.HttpClient3Connector.<init>(HttpClient3Connector.java:44)
at org.sonar.wsclient.connectors.ConnectorFactory.create(ConnectorFactory.java:30)
at org.sonar.wsclient.Sonar.create(Sonar.java:105)
at org.sonar.report.pdf.PDFReporter.getProject(PDFReporter.java:128)
at org.sonar.report.pdf.PDFReporter.getReport(PDFReporter.java:83)
at org.sonar.report.pdf.batch.PDFGenerator.execute(PDFGenerator.java:100)
at org.sonar.report.pdf.batch.PDFPostJob.executeOn(PDFPostJob.java:76)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:72)
at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:61)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:132)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:173)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
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.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:173)
... 35 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 33 seconds
[INFO] Finished at: Thu Feb 04 06:55:09 CET 2016
[INFO] Final Memory: 53M/424M
[INFO] ------------------------------------------------------------------------
channel stopped
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE


我用谷歌搜索了它,但没有找到任何测试方法。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

对您的问题的可能建议

  1. Sonarqube 4.5.1 Pdf插件已弃用,可在此link中找到相关信息。
  2. 最好能在Maven(POM.xml)中处理这个pdf生成插件。
  3. 另外,我建议通过Sonarqube 4.5.1插件版本compatibility matrix chart,因为声纳对处理版本非常敏感。
  4. 我在此link中找到了针对Sonarqube 4.5.1 PDF报告插件修复的示例。如果需要,可以在POM.xml文件中将其添加为依赖项。