如何使用Amazon Elastic BeanStalk安装Sonar服务器?

时间:2013-01-15 07:11:41

标签: sonarqube elastic-beanstalk

我尝试使用Amazon Elastic Beanstalk部署Sonar服务器。我下载了声纳分布。我跑了build-war.sh。然后使用这些说明自定义EC2实例: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

我在.ebextensions

中创建了一个sonar.war目录

在该目录中,我创建了一个包含这些内容的sonar.config文件(我的目标是解压缩声纳分布并更新SONAR_HOME环境变量:

sources:   
  /tmp: http://dist.sonar.codehaus.org/sonar-3.4.1.zip  
option_settings: 
  - option_name: SONAR_HOME  
    value: /tmp/sonar-3.4.1 

当我通过beanstalk(在Tomcat 7 / Linux 64实例上)部署sonar.war时,我收到此错误:

--- Java Exception
java.lang.NullPointerException
    at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:99)
    at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:466)

05:08:31.883 [localhost-startStop-1] ERROR jruby.rack - unable to create shared application instance
org.jruby.rack.RackInitializationException: java.lang.NullPointerException: null
    from org/sonar/server/ui/JRubyFacade.java:466:in `getServerHome'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/config/environment.rb:52:in `(root)'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/gems/gems/rails-2.3.14/lib/initializer.rb:111:in `run'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/config/environment.rb:32:in `(root)'
    from org/jruby/RubyKernel.java:1058:in `load'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/config/environment.rb:23:in `load_environment'
    from /var/cache/tomcat7/work/Catalina/localhost/_/loader/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:4791) [catalina.jar:7.0.32]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [catalina.jar:7.0.32]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.32]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.32]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.32]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) [catalina.jar:7.0.32]
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1105) [catalina.jar:7.0.32]
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1664) [catalina.jar:7.0.32]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.6.0_24]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.6.0_24]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.6.0_24]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.6.0_24]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.6.0_24]
    at java.lang.Thread.run(Thread.java:679) [na:1.6.0_24]
org.jruby.exceptions.RaiseException: Native Exception: 'class java.lang.NullPointerException'; Message: null; StackTrace: java.lang.NullPointerException
    at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:99)
    at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:466)

    at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:99) ~[JRubyFacade.class:na]
    at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:466) ~[JRubyFacade.class:na]
Caused by: java.lang.NullPointerException: null
    ... 2 common frames omitted
05:08:31.884 [localhost-startStop-1] ERROR jruby.rack - Error: application initialization failed
org.jruby.rack.RackInitializationException: java.lang.NullPointerException: null
    from org/sonar/server/ui/JRubyFacade.java:466:in `getServerHome'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/config/environment.rb:52:in `(root)'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/gems/gems/rails-2.3.14/lib/initializer.rb:111:in `run'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/config/environment.rb:32:in `(root)'
    from org/jruby/RubyKernel.java:1058:in `load'
    from /var/cache/tomcat7/temp/0-ROOT/WEB-INF/config/environment.rb:23:in `load_environment'
    from /var/cache/tomcat7/work/Catalina/localhost/_/loader/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:4791) [catalina.jar:7.0.32]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [catalina.jar:7.0.32]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.32]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.32]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.32]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) [catalina.jar:7.0.32]
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1105) [catalina.jar:7.0.32]
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1664) [catalina.jar:7.0.32]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.6.0_24]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.6.0_24]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.6.0_24]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.6.0_24]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.6.0_24]
    at java.lang.Thread.run(Thread.java:679) [na:1.6.0_24]
org.jruby.exceptions.RaiseException: Native Exception: 'class java.lang.NullPointerException'; Message: null; StackTrace: java.lang.NullPointerException
    at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:99)
    at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:466)

    at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:99) ~[JRubyFacade.class:na]
    at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:466) ~[JRubyFacade.class:na]
Caused by: java.lang.NullPointerException: null
    ... 2 common frames omitted

1 个答案:

答案 0 :(得分:1)

我遇到了类似的问题,我找到了答案here

Here is how I installed sonar on Ubuntu