在Tomcat上通过context.xml部署声纳失败

时间:2013-05-07 09:46:12

标签: sonarqube

将sonar.war直接部署到/ tomcat_sonar / webapps时,一切运行正常。

BUT: 在/ tomcat_sonar / conf / Catalina / localhost /中定义一个sonar.xml时,它指向war我收到错误。

sonar.xml:

<Context path="/sonar"
    docBase="/srv/stage/sonar.war"
    reloadable="true">
</Context>

LOG:

2013.05.07 10:38:02 ERROR jruby.rack  Error: application initialization failed
org.jruby.rack.RackInitializationException: No such file to load -- /localhost/sonar/WEB-INF/config/environment.rb
    from file:/srv/tomcat_sonar/work/Catalina/localhost/sonar/WEB-INF/lib/jruby-rack-1.1.10.jar!/jruby/rack/rails/environment2.rb:23:in `load_environment'
    from file:/srv/tomcat_sonar/work/Catalina/localhost/sonar/WEB-INF/lib/jruby-rack-1.1.10.jar!/jruby/rack/rails_booter.rb:65:in `load_environment'
    from <script>:1:in `(root)'

    at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:231) ~[jruby-rack-1.1.10.jar:na]
    at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58) ~[jruby-rack-1.1.10.jar:na]
    at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:33) ~[jruby-rack-1.1.10.jar:na]
    at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:48) ~[jruby-rack-1.1.10.jar:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765) [catalina.jar:7.0.23]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260) [catalina.jar:7.0.23]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.23]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) [catalina.jar:7.0.23]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842) [catalina.jar:7.0.23]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) [catalina.jar:7.0.23]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649) [catalina.jar:7.0.23]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581) [catalina.jar:7.0.23]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_05]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_05]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [na:1.7.0_05]
org.jruby.exceptions.RaiseException: (LoadError) No such file to load -- /localhost/sonar/WEB-INF/config/environment.rb
    at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1058) ~[jruby-complete-1.6.7.2.jar:na]
    at Rails2Environment.load_environment(file:/srv/tomcat_sonar/work/Catalina/localhost/sonar/WEB-INF/lib/jruby-rack-1.1.10.jar!/jruby/rack/rails/environment2.rb:23) ~[na:na]
    at (Anonymous).load_environment(file:/srv/tomcat_sonar/work/Catalina/localhost/sonar/WEB-INF/lib/jruby-rack-1.1.10.jar!/jruby/rack/rails_booter.rb:65) ~[na:na]
    at (Anonymous).(root)(<script>:1) ~[na:na]
2013.05.07 10:38:02 INFO  org.sonar.INFO  Stop sonar...
2013.05.07 10:38:02 INFO  org.sonar.INFO  Stop sonar done: 1 ms

有人有任何建议吗?

1 个答案:

答案 0 :(得分:0)

已解决(仅在Tomcat 7.0.x上出现问题)。 只需解压war-file并参考此目录。

<Context path="/sonar"
    docBase="/srv/stage/sonar"
    reloadable="true">
</Context>