SonarQube 4.5.1使用oracle数据库进行初始安装

时间:2014-12-10 09:16:11

标签: 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

开始声纳:

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

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

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

所以我在sonar.properties文件中添加了时区作为WEB SERVER配置的一部分。

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

并启动了声纳

StartSonar.bat

它运作良好。

谢谢。