首页 文章

失败在当地运行声纳 - 跑步者

提问于
浏览
7

我有一个声纳实例在本地机器上运行localhost:9000,我可以去使用控制台 . 当我尝试从项目的命令行运行sonar-runner时,我收到500错误:

Exception in thread "main" org.sonar.runner.RunnerException: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.bootstrap.DatabaseCompatibility.start()', instance 'org.sonar.batch.bootstrap.DatabaseCompatibility@3848110b, org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
    at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
    at org.sonar.runner.Runner.execute(Runner.java:151)
    at org.sonar.runner.Main.execute(Main.java:84)
    at org.sonar.runner.Main.main(Main.java:56)
Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.bootstrap.DatabaseCompatibility.start()', instance 'org.sonar.batch.bootstrap.DatabaseCompatibility@3848110b, org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://localhost:9000/api/server]. Response code: 500
    at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
...
...

但是当我在浏览器中访问url时,我得到以下xml响应:

<server>
<id>20131007131041</id>
<version>3.4.1</version>
<status>UP</status>
</server>

我不知道从哪里开始 . 有什么建议?

2 回答

  • 4

    当前的解决方法是在启动声纳webservice之前取消设置 GEM_PATHGEM_HOME 变量:

    unset GEM_PATH GEM_HOME
    ./sonar.sh console
    

    对于声纳 - 跑步者环境,不必这样做 .

    问题是由conflict with Ruby local installation引起的 .

  • 1

    根据声纳运行器文档,您需要在项目根目录中创建 sonar-project.properties ,然后从命令行运行 sonar-runner

    ref Sonar runner docs

    在我的情况下,它使用以下解决方法

    1: export GEM_HOME=''

    2: export GEM_PATH=''

    3:重启声纳webserver

    4:在项目路径中运行 sonar-runner

相关问题