gpt4 book ai didi

macos - 在 OS X Server 上运行的 Tomcat 6 上启动时 Sonar 抛出异常

转载 作者:行者123 更新时间:2023-12-01 11:49:03 27 4
gpt4 key购买 nike

我已经将具有正确数据库配置的 Sonar 3.3 warfile 部署到我的 MacOS 服务器上工作的 Tomcat 6:

System Version: Mac OS X 10.7.5 (11G63)
Kernel Version: Darwin 11.4.2

当它试图部署 war 时,我得到了这个:

[pool-2-thread-1] ERROR jruby.rack - Error: application initialization failed
org.jruby.rack.RackInitializationException: java.lang.NullPointerException: null
from org/sonar/server/ui/JRubyFacade.java:447:in `getServerHome'
from /usr/local/tomcat/temp/0-sonar/WEB-INF/config/environment.rb:52:in `(root)'
from /usr/local/tomcat/temp/0-sonar/WEB-INF/gems/gems/rails-2.3.14/lib/initializer.rb:111:in `run'
from /usr/local/tomcat/temp/0-sonar/WEB-INF/config/environment.rb:32:in `(root)'
from org/jruby/RubyKernel.java:1058:in `load'
from /usr/local/tomcat/temp/0-sonar/WEB-INF/config/environment.rb:23:in `load_environment'
from /usr/local/java/apache-tomcat-7.0.23/work/Catalina/localhost/sonar/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: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.deployWAR(HostConfig.java:958) [catalina.jar:7.0.23]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599) [catalina.jar:7.0.23]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_35]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_35]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_35]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_35]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_35]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_35]
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:84)
at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:447)

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

我不知道出了什么问题,这是我第一次使用 OS X。同样的 WAR 部署在 Windows 7 上没有任何问题。有什么想法吗?

最佳答案

found a solution here

你需要将 SONAR_HOME 环境变量指向你解压和构建 Sonar war 的目录

示例:

下载 Sonar 分布

wget "http://dist.sonar.codehaus.org/sonar-3.2.zip"

构建sonar.war,注意:sonar.war会被绑定(bind)到bean构建所在的目录

unzip sonar-3.2.zip -d ~/temp/sonar
mkdir /home/ubuntu/.sonar
mv ~/temp/sonar/sonar-3.2/* ~/.sonar
cd ~/.sonar/war/
./build-war.sh
cd ~

部署sonar到tomcat mv ~/.sonar/war/sonar.war ~/java/servers/sonar-tomcat-6.0.35/webapps/sonar.war

清理 - 但不要删除 ~/.sonar/因为它是 sonar_home

mv sonar-3.2.zip ~/java/utils/zip/
rm -rf ~/temp/sonar

配置 tomcat 以运行 Sonar see mkyong

printf 'CATALINA_OPTS="-Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m"\n' | tee ~/java/servers/sonar-tomcat-6.0.35/bin/setenv.sh
printf 'SONAR_HOME="~/.sonar"\n' | tee ~/java/servers/sonar-tomcat-6.0.35/bin/setenv.sh

关于macos - 在 OS X Server 上运行的 Tomcat 6 上启动时 Sonar 抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13412527/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com