com.mysql.jdbc.Driver is not found

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

com.mysql.jdbc.Driver is not found

Tobias Hirning

Hello everyone!

 

I have a Jenkins server with the Sonar plugin. The first tests were done on the build in h2 database. But for the productive work I want to switch to MySQL.

The database was installed using openSuSE's installing mechanism, is running and reachable for other applications (phpMyAdmin). MySQL version is 5.5.28 (which is said to be supported by the integrated driver).

 

Sonar uses its build-in driver which lies in /home/jenkins/sonar-3.5.1/extensions/jdbc-driver/mysql/

The file mysql-connector-java-5.1.18.jar exists, is readable and contains the Driver.class file.

 

But when I try to tell Sonar to use the database it says it can not find the driver class. I used the jdbc-url and driver settings that are recommended by the Jenkins tool tips. Additionally I'm using the database root account to eliminate site effects by wrong permissions on the database site (also didn't work with a separate database user).

 

What I am doing wrong?

 

Output looks like this (line break added for readability):

[workspace] $ /home/jenkins/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/torpedo-c/bin/sonar-runner -Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8 ******** ******** ******** ******** -Dsonar.projectBaseDir=/home/jenkins/.jenkins/jobs/C-sonar/workspace -Dsonar.sourceEncoding=UTF-8 -Dsonar.c.cppcheck.path=/home/jenkins/cppcheck-1.59/cppcheck -Dsonar.sources=src -Dsonar.language=c++ -Dsonar.c.library.directories=lib -Dsonar.projectVersion=1.0 -Dsonar.projectKey=SOFTWARE -Dproject.home=/home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/ -Dsonar.projectName=SOFTWARE

Runner configuration file: /home/jenkins/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/torpedo-c/conf/sonar-runner.properties
Project configuration file: /home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/sonar-project.properties
Runner version: 2.0
Java version: 1.6.0_27, vendor: Sun Microsystems Inc.
OS name: "Linux", version: "3.1.10-1.19-desktop", arch: "amd64"
Default locale: "de_DE", source code encoding: "UTF-8"
Server: http://localhost:9000
Work directory: /home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/.sonar
00:25:03.677 INFO  .s.b.b.BatchSettings - Load batch settings
00:25:03.804 INFO     o.s.h.c.FileCache - User cache: /home/jenkins/.sonar/cache
00:25:03.808 INFO  atchPluginRepository - Install plugins
00:25:04.182 INFO  .s.b.b.TaskContainer - -------------  Executing Project Scan
00:25:04.441 INFO  b.b.JdbcDriverHolder - Install JDBC driver
00:25:04.443 INFO  .b.ProjectExclusions - Apply project exclusions
00:25:04.445 INFO      o.s.c.p.Database - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8
Total time: 1.223s
Final Memory: 4M/240M
Exception in thread "main" org.sonar.runner.RunnerException: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()',
 instance 'Database[jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8], java.lang.RuntimeException: wrapper
	at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
	at org.sonar.runner.Runner.execute(Runner.java:151)
	at org.sonar.runner.Main.execute(Main.java:84)
	at org.sonar.runner.Main.main(Main.java:56)
Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()',
 instance 'Database[jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8], java.lang.RuntimeException: wrapper
	at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:72)
	at org.sonar.batch.bootstrap.Container.start(Container.java:71)
	at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
	at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
	at org.sonar.batch.bootstrap.Container.start(Container.java:72)
	at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
	at org.sonar.batch.bootstrap.Container.start(Container.java:72)
	at org.sonar.batch.Batch.execute(Batch.java:106)
	at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:69)
	at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.sonar.runner.Runner.delegateExecution(Runner.java:285)
	... 3 more
Caused by: java.lang.RuntimeException: wrapper
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
	... 27 more
Caused by: java.lang.IllegalStateException: Fail to connect to database
	at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
	... 26 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
	at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
	at org.apache.commons.dbcp.BasicDataSource.getLogWriter(BasicDataSource.java:1098)
	at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:350)
	at org.sonar.core.persistence.DefaultDatabase.initDatasource(DefaultDatabase.java:131)
	at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:68)
	... 31 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
	... 36 more
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE

 

Thanks for any help! :-)

 

Tobias

--

GPG-Fingerprint: C39E 5381 7721 8613 B5C9 CFAF 54FC B8DB D02D 7085

Diese E-Mail wurde mit einer fortgeschrittenen elektronischen

Signatur nach § 2 2. d) SigG signiert.


signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Freddy Mallet
Hi Tobias, 

You must first configure and restart your Sonar server to use this MySQL DB and only then you'll be able to launch a Sonar analysis using this MySQL DB.

Kind regards

-----
Sonar for Continuous Inspection


On Wed, May 1, 2013 at 12:49 AM, Tobias Hirning <[hidden email]> wrote:

Hello everyone!

 

I have a Jenkins server with the Sonar plugin. The first tests were done on the build in h2 database. But for the productive work I want to switch to MySQL.

The database was installed using openSuSE's installing mechanism, is running and reachable for other applications (phpMyAdmin). MySQL version is 5.5.28 (which is said to be supported by the integrated driver).

 

Sonar uses its build-in driver which lies in /home/jenkins/sonar-3.5.1/extensions/jdbc-driver/mysql/

The file mysql-connector-java-5.1.18.jar exists, is readable and contains the Driver.class file.

 

But when I try to tell Sonar to use the database it says it can not find the driver class. I used the jdbc-url and driver settings that are recommended by the Jenkins tool tips. Additionally I'm using the database root account to eliminate site effects by wrong permissions on the database site (also didn't work with a separate database user).

 

What I am doing wrong?

 

Output looks like this (line break added for readability):

[workspace] $ /home/jenkins/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/torpedo-c/bin/sonar-runner -Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8 ******** ******** ******** ******** -Dsonar.projectBaseDir=/home/jenkins/.jenkins/jobs/C-sonar/workspace -Dsonar.sourceEncoding=UTF-8 -Dsonar.c.cppcheck.path=/home/jenkins/cppcheck-1.59/cppcheck -Dsonar.sources=src -Dsonar.language=c++ -Dsonar.c.library.directories=lib -Dsonar.projectVersion=1.0 -Dsonar.projectKey=SOFTWARE -Dproject.home=/home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/ -Dsonar.projectName=SOFTWARE

Runner configuration file: /home/jenkins/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/torpedo-c/conf/sonar-runner.properties
Project configuration file: /home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/sonar-project.properties
Runner version: 2.0
Java version: 1.6.0_27, vendor: Sun Microsystems Inc.
OS name: "Linux", version: "3.1.10-1.19-desktop", arch: "amd64"
Default locale: "de_DE", source code encoding: "UTF-8"
Server: http://localhost:9000
Work directory: /home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/.sonar
00:25:03.677 INFO  .s.b.b.BatchSettings - Load batch settings
00:25:03.804 INFO     o.s.h.c.FileCache - User cache: /home/jenkins/.sonar/cache
00:25:03.808 INFO  atchPluginRepository - Install plugins
00:25:04.182 INFO  .s.b.b.TaskContainer - -------------  Executing Project Scan
00:25:04.441 INFO  b.b.JdbcDriverHolder - Install JDBC driver
00:25:04.443 INFO  .b.ProjectExclusions - Apply project exclusions
00:25:04.445 INFO      o.s.c.p.Database - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8
Total time: 1.223s
Final Memory: 4M/240M
Exception in thread "main" org.sonar.runner.RunnerException: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()',
 instance 'Database[jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8], java.lang.RuntimeException: wrapper
	at org.sonar.runner.Runner.delegateExecution(Runner.java:288)
	at org.sonar.runner.Runner.execute(Runner.java:151)
	at org.sonar.runner.Main.execute(Main.java:84)
	at org.sonar.runner.Main.main(Main.java:56)
Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()',
 instance 'Database[jdbc:mysql://localhost:3306/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8], java.lang.RuntimeException: wrapper
	at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:72)
	at org.sonar.batch.bootstrap.Container.start(Container.java:71)
	at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
	at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
	at org.sonar.batch.bootstrap.Container.start(Container.java:72)
	at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
	at org.sonar.batch.bootstrap.Container.start(Container.java:72)
	at org.sonar.batch.Batch.execute(Batch.java:106)
	at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:69)
	at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.sonar.runner.Runner.delegateExecution(Runner.java:285)
	... 3 more
Caused by: java.lang.RuntimeException: wrapper
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
	... 27 more
Caused by: java.lang.IllegalStateException: Fail to connect to database
	at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
	... 26 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
	at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
	at org.apache.commons.dbcp.BasicDataSource.getLogWriter(BasicDataSource.java:1098)
	at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:350)
	at org.sonar.core.persistence.DefaultDatabase.initDatasource(DefaultDatabase.java:131)
	at org.sonar.core.persistence.DefaultDatabase.start(DefaultDatabase.java:68)
	... 31 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
	... 36 more
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE

 

Thanks for any help! :-)

 

Tobias

--

GPG-Fingerprint: C39E 5381 7721 8613 B5C9 CFAF 54FC B8DB D02D 7085

Diese E-Mail wurde mit einer fortgeschrittenen elektronischen

Signatur nach § 2 2. d) SigG signiert.


Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Tobias Hirning

Hello Freddy!

Am Mittwoch, 1. Mai 2013, 10:37:21 schrieben Sie:

> Hi Tobias,

>

> You must first configure and restart your Sonar server to use this MySQL DB

> and only then you'll be able to launch a Sonar analysis using this MySQL DB.

Thanks! It seems that restarting the Sonar server solved the driver problem.

 

But now it tells me the server version could not be requested:

Server: http://localhost:9000
Work directory: /home/jenkins/.jenkins/jobs/C-sonar/workspace/SGpp-trunk/.sonar
Total time: 0.020s
Final Memory: 1M/240M
Exception in thread "main" java.lang.IllegalStateException: Fail to request server version
	at org.sonar.runner.Bootstrapper.getServerVersion(Bootstrapper.java:73)
	at org.sonar.runner.Runner.checkSonarVersion(Runner.java:220)
	at org.sonar.runner.Runner.execute(Runner.java:150)
	at org.sonar.runner.Main.execute(Main.java:84)
	at org.sonar.runner.Main.main(Main.java:56)
Caused by: java.net.ConnectException: Connection refused
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
	at java.net.Socket.connect(Socket.java:546)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:173)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:240)
	at sun.net.www.http.HttpClient.New(HttpClient.java:321)
	at sun.net.www.http.HttpClient.New(HttpClient.java:338)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
	at java.net.URLConnection.getContent(URLConnection.java:705)
	at org.sonar.runner.Bootstrapper.remoteContent(Bootstrapper.java:125)
	at org.sonar.runner.Bootstrapper.getServerVersion(Bootstrapper.java:71)
	... 4 more
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE

Any ideas? Database settings in Sonar seem to be correct for me (checked user/passwort and port multiple times).

 

 

> [...]

> > [...]

 

Tobias

--

GPG-Fingerprint: C39E 5381 7721 8613 B5C9 CFAF 54FC B8DB D02D 7085

Diese E-Mail wurde mit einer fortgeschrittenen elektronischen

Signatur nach § 2 2. d) SigG signiert.


signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Christian Schulz
Hello Tobias,

where is your sonar running?
You have to pass the parameters to the sonar runner.
It is trying to use localhost on port 9000.

Best Regards,

Christian Schulz


Am 01.05.2013 13:31, schrieb Tobias Hirning:

Hello Freddy!

Am Mittwoch, 1. Mai 2013, 10:37:21 schrieben Sie:

> Hi Tobias,

>

> You must first configure and restart your Sonar server to use this MySQL DB

> and only then you'll be able to launch a Sonar analysis using this MySQL DB.

Thanks! It seems that restarting the Sonar server solved the driver problem.

 

But now it tells me the server version could not be requested:

Server: http://localhost:9000
Work directory: /home/jenkins/.jenkins/jobs/C-sonar/workspace/SGpp-trunk/.sonar
Total time: 0.020s
Final Memory: 1M/240M
Exception in thread "main" java.lang.IllegalStateException: Fail to request server version
	at org.sonar.runner.Bootstrapper.getServerVersion(Bootstrapper.java:73)
	at org.sonar.runner.Runner.checkSonarVersion(Runner.java:220)
	at org.sonar.runner.Runner.execute(Runner.java:150)
	at org.sonar.runner.Main.execute(Main.java:84)
	at org.sonar.runner.Main.main(Main.java:56)
Caused by: java.net.ConnectException: Connection refused
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
	at java.net.Socket.connect(Socket.java:546)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:173)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:240)
	at sun.net.www.http.HttpClient.New(HttpClient.java:321)
	at sun.net.www.http.HttpClient.New(HttpClient.java:338)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
	at java.net.URLConnection.getContent(URLConnection.java:705)
	at org.sonar.runner.Bootstrapper.remoteContent(Bootstrapper.java:125)
	at org.sonar.runner.Bootstrapper.getServerVersion(Bootstrapper.java:71)
	... 4 more
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE

Any ideas? Database settings in Sonar seem to be correct for me (checked user/passwort and port multiple times).

 

 

> [...]

> > [...]

 

Tobias

--

GPG-Fingerprint: C39E 5381 7721 8613 B5C9 CFAF 54FC B8DB D02D 7085

Diese E-Mail wurde mit einer fortgeschrittenen elektronischen

Signatur nach § 2 2. d) SigG signiert.


Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Tobias Hirning
Hello Christian!
Am Mittwoch, 1. Mai 2013, 15:18:48 schrieben Sie:
> Hello Tobias,
>
> where is your sonar running?
> You have to pass the parameters to the sonar runner.
> It is trying to use localhost on port 9000.
It is up and running on localhost:9000. It worked fine with the build in h2
database.

Tobias
> [...]
> > [...]
--
GPG-Fingerprint: C39E 5381 7721 8613 B5C9  CFAF 54FC B8DB D02D 7085
Diese E-Mail wurde mit einer fortgeschrittenen elektronischen
Signatur nach § 2 2. d) SigG signiert.

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Christian Schulz
Hello Tobias,

so your sonar runner is on the same machine like your sonar instance?
Please don't remove the last messages, sometimes it is hard to get the
context back.

Best Regards,

Christian Schulz

Am 01.05.2013 15:39, schrieb Tobias Hirning:

> Hello Christian!
> Am Mittwoch, 1. Mai 2013, 15:18:48 schrieben Sie:
>> Hello Tobias,
>>
>> where is your sonar running?
>> You have to pass the parameters to the sonar runner.
>> It is trying to use localhost on port 9000.
> It is up and running on localhost:9000. It worked fine with the build in h2
> database.
>
> Tobias

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Tobias Hirning
Hello Christian!
Am Mittwoch, 1. Mai 2013, 15:49:13 schrieben Sie:
> Hello Tobias,
>
> so your sonar runner is on the same machine like your sonar instance?
> Please don't remove the last messages, sometimes it is hard to get the
> context back.
Yes, sonar runner and sonar server are on the same machine. It worked fine with
the build in h2 database. Now I want to switch to a mysql database.

Tobias

>
> Best Regards,
>
> Christian Schulz
>
> Am 01.05.2013 15:39, schrieb Tobias Hirning:
> > Hello Christian!
> >
> > Am Mittwoch, 1. Mai 2013, 15:18:48 schrieben Sie:
> >> Hello Tobias,
> >>
> >> where is your sonar running?
> >> You have to pass the parameters to the sonar runner.
> >> It is trying to use localhost on port 9000.
> >
> > It is up and running on localhost:9000. It worked fine with the build in
> > h2
> > database.
> >
> > Tobias
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
--
GPG-Fingerprint: C39E 5381 7721 8613 B5C9  CFAF 54FC B8DB D02D 7085
Diese E-Mail wurde mit einer fortgeschrittenen elektronischen
Signatur nach § 2 2. d) SigG signiert.

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Freddy Mallet
Tobias, could you send the log file of your Sonar server ?

Thanks

-----
Sonar for Continuous Inspection


On Wed, May 1, 2013 at 4:07 PM, Tobias Hirning <[hidden email]> wrote:
Hello Christian!
Am Mittwoch, 1. Mai 2013, 15:49:13 schrieben Sie:
> Hello Tobias,
>
> so your sonar runner is on the same machine like your sonar instance?
> Please don't remove the last messages, sometimes it is hard to get the
> context back.
Yes, sonar runner and sonar server are on the same machine. It worked fine with
the build in h2 database. Now I want to switch to a mysql database.

Tobias
>
> Best Regards,
>
> Christian Schulz
>
> Am 01.05.2013 15:39, schrieb Tobias Hirning:
> > Hello Christian!
> >
> > Am Mittwoch, 1. Mai 2013, 15:18:48 schrieben Sie:
> >> Hello Tobias,
> >>
> >> where is your sonar running?
> >> You have to pass the parameters to the sonar runner.
> >> It is trying to use localhost on port 9000.
> >
> > It is up and running on localhost:9000. It worked fine with the build in
> > h2
> > database.
> >
> > Tobias
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
--
GPG-Fingerprint: C39E 5381 7721 8613 B5C9  CFAF 54FC B8DB D02D 7085
Diese E-Mail wurde mit einer fortgeschrittenen elektronischen
Signatur nach § 2 2. d) SigG signiert.

Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Tobias Hirning
Am Donnerstag, 2. Mai 2013, 21:52:18 schrieben Sie:
> Tobias, could you send the log file of your Sonar server ?
Log is attached.

What I did to produce the log file:

1. Start sonar server.
2. Execute analysis with mysql configuration.
3. First restart of sonar server because Driver.class was not found.
4. Execute analysis with mysql configuration.
5. Second restart of sonar server because Driver.class was not found.
6. Execute analysis with mysql configuration. Now it says again that the server
version can't be telled.
7. Changed configuration to build in h2 and restarted sonar server.
8. Execute analysis with h2 configuration. Works fine.

Tobias

> [...]
> > [...]
--
GPG-Fingerprint: C39E 5381 7721 8613 B5C9  CFAF 54FC B8DB D02D 7085
Diese E-Mail wurde mit einer fortgeschrittenen elektronischen
Signatur nach § 2 2. d) SigG signiert.

sonar.log (41K) Download Attachment
signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Ann Campbell
I'm a little confused - does 'driver not found' show up on the analysis log? I didn't notice it in the server log. What I do see is server shutdown about 30 seconds after the first startup. Is that because you'd already gotten 'driver not found' in your analysis log?

You'll need to configure both the server and Sonar Runner for the database, and I suspect that's where your problem is. I don't have it in front of me, but it seems like Sonar Runner also defaults to H2, which is why your analysis worked when you switched the server back to H2.



---
G. Ann Campbell
Sr. Systems Engineer, IS Production Systems - Shop Floor Systems
Shaw Industries Inc,
201 S. Hamilton St.
Dalton Ga 30720


On Sun, May 5, 2013 at 6:12 AM, Tobias Hirning <[hidden email]> wrote:
Am Donnerstag, 2. Mai 2013, 21:52:18 schrieben Sie:
> Tobias, could you send the log file of your Sonar server ?
Log is attached.

What I did to produce the log file:

1. Start sonar server.
2. Execute analysis with mysql configuration.
3. First restart of sonar server because Driver.class was not found.
4. Execute analysis with mysql configuration.
5. Second restart of sonar server because Driver.class was not found.
6. Execute analysis with mysql configuration. Now it says again that the server
version can't be telled.
7. Changed configuration to build in h2 and restarted sonar server.
8. Execute analysis with h2 configuration. Works fine.

Tobias

> [...]
> > [...]
--
GPG-Fingerprint: C39E 5381 7721 8613 B5C9  CFAF 54FC B8DB D02D 7085
Diese E-Mail wurde mit einer fortgeschrittenen elektronischen
Signatur nach § 2 2. d) SigG signiert.


**********************************************************
Privileged and/or confidential information may be contained in this message. If you are not the addressee indicated in this message (or are not responsible for delivery of this message to that person) , you may not copy or deliver this message to anyone. In such case, you should destroy this message and notify the sender by reply e-mail.
If you or your employer do not consent to Internet e-mail for messages of this kind, please advise the sender.
Shaw Industries does not provide or endorse any opinions, conclusions or other information in this message that do not relate to the official business of the company  or its subsidiaries.
**********************************************************

Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Tobias Hirning

Hello Ann!

Am Sonntag, 5. Mai 2013, 10:34:36 schrieben Sie:

> I'm a little confused - does 'driver not found' show up on the analysis

> log? I didn't notice it in the server log. What I do see is server shutdown

> about 30 seconds after the first startup. Is that because you'd already

> gotten 'driver not found' in your *analysis* log?

Yes, it shows up in the analysis log. The server shutdowns that can be seen are done manually by myself when switching the database.

 

>

> You'll need to configure both the server *and Sonar Runner* for the

> database, and I suspect that's where your problem is. I don't have it in

> front of me, but it seems like Sonar Runner also defaults to H2, which is

> why your analysis worked when you switched the server back to H2.

The sonar runner is configured. From the analysis log:

/home/jenkins/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/torpedo-c/bin/sonar-runner -Dsonar.jdbc.driver=com.mysql.jdbc.Driver ******** ******** -Dsonar.projectBaseDir=/home/jenkins/.jenkins/jobs/C-sonar/workspace -Dsonar.sourceEncoding=UTF-8 -Dsonar.c.cppcheck.path=/home/jenkins/cppcheck-1.59/cppcheck -Dsonar.sources=src -Dsonar.language=c++ -Dsonar.cxx.cppcheck.path=/home/jenkins/cppcheck-1.59/cppcheck -Dsonar.c.library.directories=lib -Dsonar.projectVersion=1.0 -Dsonar.projectKey=SOFTWARE -Dproject.home=/home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/ -Dsonar.projectName=SOFTWARE

 

Tobias

 

> [...]

> > [...]

--

GPG-Fingerprint: C39E 5381 7721 8613 B5C9 CFAF 54FC B8DB D02D 7085

Diese E-Mail wurde mit einer fortgeschrittenen elektronischen

Signatur nach § 2 2. d) SigG signiert.


signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Freddy Mallet
Hi Tobias,

Ann is right, the message on Sonar server side is pretty clear : 

2013.05.05 11:56:35 INFO  o.s.s.d.EmbeddedDatabase  Embedded database started. Data stored in: /home/jenkins/sonar-3.5.1/data
2013.05.05 11:56:35 WARN  o.s.c.p.DefaultDatabase  H2 database should be used for evaluation purpose only
2013.05.05 11:56:35 INFO  o.s.c.p.Database  Create JDBC datasource for jdbc:h2:tcp://localhost:9092/sonar

Your Sonar server is not yet configured to use mysql. As long as this is not the case, you won't manage to analyse any project while using mysql. 

Kind regards
Freddy



-----
Sonar for Continuous Inspection


On Sun, May 5, 2013 at 4:54 PM, Tobias Hirning <[hidden email]> wrote:

Hello Ann!

Am Sonntag, 5. Mai 2013, 10:34:36 schrieben Sie:

> I'm a little confused - does 'driver not found' show up on the analysis

> log? I didn't notice it in the server log. What I do see is server shutdown

> about 30 seconds after the first startup. Is that because you'd already

> gotten 'driver not found' in your *analysis* log?

Yes, it shows up in the analysis log. The server shutdowns that can be seen are done manually by myself when switching the database.

 

>

> You'll need to configure both the server *and Sonar Runner* for the

> database, and I suspect that's where your problem is. I don't have it in

> front of me, but it seems like Sonar Runner also defaults to H2, which is

> why your analysis worked when you switched the server back to H2.

The sonar runner is configured. From the analysis log:

/home/jenkins/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/torpedo-c/bin/sonar-runner -Dsonar.jdbc.driver=com.mysql.jdbc.Driver ******** ******** -Dsonar.projectBaseDir=/home/jenkins/.jenkins/jobs/C-sonar/workspace -Dsonar.sourceEncoding=UTF-8 -Dsonar.c.cppcheck.path=/home/jenkins/cppcheck-1.59/cppcheck -Dsonar.sources=src -Dsonar.language=c++ -Dsonar.cxx.cppcheck.path=/home/jenkins/cppcheck-1.59/cppcheck -Dsonar.c.library.directories=lib -Dsonar.projectVersion=1.0 -Dsonar.projectKey=SOFTWARE -Dproject.home=/home/jenkins/.jenkins/jobs/C-sonar/workspace/SOFTWARE/ -Dsonar.projectName=SOFTWARE

 

Tobias

 

> [...]

> > [...]

--

GPG-Fingerprint: C39E 5381 7721 8613 B5C9 CFAF 54FC B8DB D02D 7085

Diese E-Mail wurde mit einer fortgeschrittenen elektronischen

Signatur nach § 2 2. d) SigG signiert.


Reply | Threaded
Open this post in threaded view
|

Re: com.mysql.jdbc.Driver is not found

Tobias Hirning
Hello Freddy!

Am Sonntag, 5. Mai 2013, 20:45:41 schrieben Sie:

> Hi Tobias,
>
> Ann is right, the message on Sonar server side is pretty clear :
>
> *2013.05.05 11:56:35 INFO  o.s.s.d.EmbeddedDatabase  Embedded database
> started. Data stored in: /home/jenkins/sonar-3.5.1/data*
> *2013.05.05 11:56:35 WARN  o.s.c.p.DefaultDatabase  H2 database should be
> used for evaluation purpose only*
> *2013.05.05 11:56:35 INFO  o.s.c.p.Database  Create JDBC datasource for
> jdbc:h2:tcp://localhost:9092/sonar*
>
> Your Sonar server is not yet configured to use mysql. As long as this is
> not the case, you won't manage to analyse any project while using mysql.
Ah, I see. Your right. :-)
I didn't see the step on configuring the server in the sonar.properties. I've
always thought, this was done through the Jenkins preferences page where the
credentials and the database settings also have to be set.

Thank you all very much! :-)

Tobias

> [...]
> > [...]
--
GPG-Fingerprint: C39E 5381 7721 8613 B5C9  CFAF 54FC B8DB D02D 7085
Diese E-Mail wurde mit einer fortgeschrittenen elektronischen
Signatur nach § 2 2. d) SigG signiert.

signature.asc (205 bytes) Download Attachment