java - SonarQube 4.5.1 初始安装与oracle数据库

标签 java sonarqube

我已经安装了 oracle 数据库 11g,并且正在 Windows 上运行它。我按照以下说明操作:

http://docs.codehaus.org/display/SONAR/Setup+and+Upgrade

数据库用户创建:

CREATE USER sonar IDENTIFIED BY sonar;
GRANT UNLIMITED TABLESPACE, CONNECT, RESOURCE, CREATE SESSION, CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE SEQUENCE, CREATE PROCEDURE, CREATE TRIGGER TO sonar;

下载oracle驱动ojdbc6.jar

将其复制到sonar-4.5.1\extensions\jdbc-driver\oracle

更新了 sonar.properties 文件

sonar.jdbc.username=sonar
sonar.jdbc.password=sonar

sonar.jdbc.url=jdbc:oracle:thin:@localhost:1521/orcl
sonar.jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
sonar.jdbc.validationQuery:select 1 from dual

启动 Sonar :

C:\sonarqube\bin\windows-x86-xx\StartSonar.bat

启动失败,并显示来自 sonar.log 的错误日志

--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2014.12.09 16:06:09 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[search]: C:\Program Files\Java\jdk1.6.0_30\jre\bin\java -Djava.awt.headless=true -Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\SonarQube\sonarqube-4.5.1\temp -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\Users\trzsa\AppData\Local\Temp\sq-process4414189320052418606properties
2014.12.09 16:06:10 WARN  sea[o.s.p.ProcessEntryPoint]  Starting search
2014.12.09 16:06:10 INFO  sea[o.s.s.SearchServer]  Starting ES[sonarqube] on port: 9001
2014.12.09 16:06:10 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] version[1.1.2], pid[6996], build[e511f7b/2014-05-22T12:27:39Z]
2014.12.09 16:06:10 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] initializing ...
2014.12.09 16:06:10 INFO  sea[o.e.plugins]  [sonar-1418133969404] loaded [], sites []
2014.12.09 16:06:11 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] initialized
2014.12.09 16:06:11 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] starting ...
2014.12.09 16:06:11 INFO  sea[o.e.transport]  [sonar-1418133969404] bound_address {inet[/0.0.0.0:9001]}, publish_address {inet[/10.34.51.66:9001]}
2014.12.09 16:06:14 INFO  sea[o.e.cluster.service]  [sonar-1418133969404] new_master [sonar-1418133969404][dgz945TsTu6beoQ0xWOxhw][TRCPU5601][inet[/10.34.51.66:9001]]{rack_id=sonar-1418133969404}, reason: zen-disco-join (elected_as_master)
2014.12.09 16:06:14 INFO  sea[o.e.discovery]  [sonar-1418133969404] sonarqube/dgz945TsTu6beoQ0xWOxhw
2014.12.09 16:06:15 INFO  sea[o.e.gateway]  [sonar-1418133969404] recovered [2] indices into cluster_state
2014.12.09 16:06:15 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] started
2014.12.09 16:06:16 INFO  app[o.s.p.m.Monitor] Process[search] is up
2014.12.09 16:06:16 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[web]: C:\Program Files\Java\jdk1.6.0_30\jre\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\SonarQube\sonarqube-4.5.1\temp -cp ./lib/common/*;./lib/server/*;C:\SonarQube\sonarqube-4.5.1\extensions\jdbc-driver\oracle\ojdbc6.jar org.sonar.server.app.WebServer C:\Users\user\AppData\Local\Temp\sq-process9150010560930103521properties
2014.12.09 16:06:16 WARN  web[o.s.p.ProcessEntryPoint]  Starting web
2014.12.09 16:06:16 INFO  web[o.s.s.app.Connectors]  HTTP connector is enabled on port 9000
2014.12.09 16:06:16 INFO  web[o.s.s.app.Webapp]  Webapp directory: C:\SonarQube\sonarqube-4.5.1\web
2014.12.09 16:06:17 INFO  web[o.e.plugins]  [sonar-1418133969404] loaded [], sites []
2014.12.09 16:06:18 INFO  web[o.s.s.p.ServerImpl]  SonarQube Server / 4.5.1 / 0c5e3bad51d43c05de47187d16831067bea16a3f
2014.12.09 16:06:18 INFO  web[o.s.c.p.Database]  Create JDBC datasource for jdbc:oracle:thin:@localhost:1521/orcl
2014.12.09 16:06:18 ERROR web[o.a.c.c.C.[.[.[/]]  Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
    ...........................................
2014.12.09 16:06:23 ERROR web[o.a.c.c.StandardContext]  Error listenerStart
2014.12.09 16:06:23 ERROR web[o.a.c.c.StandardContext]  Context [] startup failed due to previous errors
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][[timer]]] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][scheduler][T#1]] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#1]{New I/O worker #1}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#2]{New I/O worker #2}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#3]{New I/O worker #3}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#4]{New I/O worker #4}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#5]{New I/O worker #5}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#6]{New I/O worker #6}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#7]{New I/O worker #7}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#8]{New I/O worker #8}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#9]{New I/O worker #9}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#10]{New I/O worker #10}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#11]{New I/O worker #11}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#12]{New I/O worker #12}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#13]{New I/O worker #13}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#14]{New I/O worker #14}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#15]{New I/O worker #15}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_worker][T#16]{New I/O worker #16}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_boss][T#1]{New I/O boss #17}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][transport_client_timer][T#1]{Hashed wheel timer #1}] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [elasticsearch[sonar-1418133969404][generic][T#1]] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [JRubyJIT-1] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 ERROR web[o.a.c.l.WebappClassLoader]  The web application [] appears to have started a thread named [JRubyJIT-2] but has failed to stop it. This is very likely to create a memory leak.
2014.12.09 16:06:23 INFO  web[o.s.s.app.Logging]  Web server is started
2014.12.09 16:06:23 WARN  web[o.s.p.ProcessEntryPoint]  Fail to start web
............................
2014.12.09 16:06:24 INFO  web[o.s.s.app.Logging]  Web server is stopped
2014.12.09 16:06:24 INFO  sea[o.s.p.StopWatcher]  Stopping process
2014.12.09 16:06:24 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] stopping ...
2014.12.09 16:06:24 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] stopped
2014.12.09 16:06:24 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] closing ...
2014.12.09 16:06:24 INFO  sea[o.elasticsearch.node]  [sonar-1418133969404] closed
2014.12.09 16:06:24 INFO  app[o.s.p.m.TerminatorThread] Process[search] is stopping
2014.12.09 16:06:24 INFO  app[o.s.p.m.TerminatorThread] Process[search] is stopped
<-- Wrapper Stopped

任何帮助将不胜感激。

最佳答案

感谢大家的想法,当我尝试使用独立的 java 应用程序连接到 Sonar 数据库时,我意识到我需要为 JVM 配置时区。

因此,我将时区添加为 sonar.properties 文件中 WEB 服务器配置的一部分。

sonar.web.javaAdditionalOpts=-Duser.timezone=Africa/Johannesburg

并启动 Sonar

启动Sonar.bat

效果很好。

谢谢。

关于java - SonarQube 4.5.1 初始安装与oracle数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27397173/

相关文章:

Java反射获取子类变量值/从成员字段获取对象实例

java - 创建操作作业的队列

jenkins - 超出 Sonar 限制时使 Jenkins Build 不稳定

gradle - Artifactory找不到SonarQube Gradle插件

gradle - 使用 Gradle 在本地执行 SonarQube 分析,无需推送

Java进程IO

java - 处理 java 管道流中的异常

java - 嵌套 For 循环动态深度 Java

带有@Inject注解的Java方法: False-positive for the rule "Unused "private"methods should be removed"?

java - Sonarqube, "String contains no format specifiers"记录常量字符串消息时