2014-01-08 2 views
3

천천히 미쳐 갈 것입니다.소나 러너 : Windows 7 : 시작시 jdbc에 대한 오류가 발생했습니다.

Windows 7 64 비트, 최신 SonarQube 및 러너 2.3을 사용 중입니다. 내가 디버그 정보를 수집 할 때

C:\myRoot\SonarQube\SonarQubeRunner\sonar-runner-dist-2.3\sonar-runner-2.3 
SonarQube Runner 2.3 
Java 1.7.0_45 Oracle Corporation (64-bit) 
Windows 7 6.1 amd64 
INFO: Runner configuration file: C:\myRoot\SonarQube\SonarQubeRunner\sonar-runner-dist-2.3\sonar-runner-2.3\conf\sonar-runner.properties 
INFO: Project configuration file: NONE 
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent) 
INFO: Work directory: C:\myRoot\SonarQube\sonar_examples\sonar-examples-master\projects\languages\php\php-sonar-runner\src\.sonar 
INFO: SonarQube Server 4.0 
14:18:52.103 INFO - Load batch settings 
14:18:52.196 INFO - User cache: C:\Users\myName\.sonar\cache 
14:18:52.212 INFO - Install plugins 
14:18:52.602 INFO - Install JDBC driver 
14:18:52.602 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar 
INFO: ------------------------------------------------------------------------ 
INFO: EXECUTION FAILURE 
INFO: ------------------------------------------------------------------------ 
Total time: 1.700s 
Final Memory: 4M/74M 
INFO: ------------------------------------------------------------------------ 
ERROR: Error during Sonar runner execution 
ERROR: Unable to execute Sonar 
ERROR: Caused by: Fail to connect to database 
ERROR: Caused by: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' 
ERROR: Caused by: com.mysql.jdbc.Driver 
ERROR: 
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch. 
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging. 

내가 얻을 :

 yadda, yadda ... 
     ... 32 more 
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 
     at java.net.URLClassLoader$1.run(Unknown Source) 
     at java.net.URLClassLoader$1.run(Unknown Source) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at java.net.URLClassLoader.findClass(Unknown Source) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420) 
     ... 37 more 
내가 얻을 수중 음파 탐지기 - runner.bat를 실행하려고하면

나는 SonarQube 포트 9000

에 대해 실행 한

다음 위치에 mysql-connector-java-5.1.26.jar 파일이 있습니다.

C:\myRoot\SonarQube\sonarqube-4.0\sonarqube-4.0\extensions\jdbc-driver\mysql 

왜 찾을 수 없는지 나는 생각할 수 없습니다.

내 .properities 파일은 매우 간단합니다.

모든 조언을 주시면 감사하겠습니다.

읽어 주셔서 감사합니다.

+0

JAR을 찾으려면 클래스 경로에 있어야합니다. 이 프로그램을 실행하기 위해 일종의 .BAT 파일을 사용하고있는 것 같습니다. 거기서 시작해서 CLASSPATH 변수가 정의되어 있는지 살펴 보겠습니다. – CodeChimp

답변

0

Linux Mint Debian Edition을 사용하는 Jenkins 설정에서 동일한 오류 메시지가 나타납니다. 나는 나를 위해 문제를 해결 SonarQube 서버를 다시 시작 읽어 SonarQube 러너 2.3 SonarQube 서버 4.1.1

ERROR: Unable to execute SonarERROR: Caused by: Fail to connect to database 
ERROR: Caused by: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' 
ERROR: Caused by: com.mysql.jdbc.Driver 

Here을 사용했다.

나는 그것이 사소한 것이지만 그것이 내 경우에는 모든 것이었고, 작은 것들을 간과하기 쉽습니다.

0

로컬 Mysql 데이터베이스를 사용하려는 경우이 코드를 sonarcube의 sonar.properties 파일에서 사용하십시오.

# Permissions to create tables, indices and triggers must be granted to JDBC user. 
# The schema must be created first. 
sonar.jdbc.username=root 
sonar.jdbc.password=root 

#----- MySQL 5.x 
# Comment the embedded database and uncomment the following line to use MySQL 
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonardb?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true 
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver 
sonar.jdbc.validationQuery: select 1 

마지막 2 개 개의 라인 코드

은 MySQL을위한 수중 음파 탐지기 자습서 중 하나로 지정되어 있지 않습니다.

마지막으로 적절한 값으로 SONAR_RUNNER_HOME을 만들고 경로 변수 항목을 bin 디렉토리까지 만들어야합니다.

관련 문제