Sonar Runner : Windows 7 : Throwing error against jdbc on start - java

I'm going slowly mad.
I'm on windows 7 64 bit, using the latest SonarQube and runner 2.3.
I have SonarQube running against port 9000.
When I try to run sonar-runner.bat I get:
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.
When I collect the debug info I get:
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
I have a file called mysql-connector-java-5.1.26.jar at:
C:\myRoot\SonarQube\sonarqube-4.0\sonarqube-4.0\extensions\jdbc-driver\mysql
I can't think why it's not being found.
My .properities file is fairly simple.
ANY advice would be much appreciated.
Thanks for reading.

I had the same error message on my Jenkins setup using Linux Mint Debian Edition. I used SonarQube Runner 2.3 and SonarQube Server 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 I read to restart the SonarQube server, which solved the issue for me.
I know it's trivial but that's all there was to it in my case and it's easy to overlook the little things.

if you are trying with your local Mysql data base then use these codes in your sonar.properties file of sonarcube.
# 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
the last two line code is not specified in any of the sonar tutorials for Mysql.
And finally make sure you have created SONAR_RUNNER_HOME with proper value and the path variable entry up to the bin directory.

Related

IBM Worklight server failing to start project

Windows 7; Java 1.7; Worklight 7.0:
Just started getting this error; has anyone else run into this?
`
[ERROR ] FWLSE0320E: Failed to check whether the admin services are ready. Caused by: [project rta]
Connection refused: connect
[ERROR ] FWLST0003E: ========= Failed starting project /rta [project rta]
java.lang.reflect.InvocationTargetException
[ERROR ] null
java.lang.reflect.InvocationTargetException
[ERROR ] FWLSE4011E: StatusMessage [severity=ERROR, message='null', timestamp=1462897073437, detailedMessage=java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at com.worklight.server.bundle.project.JeeProjectActivator$1.run(JeeProjectActivator.java:239)
at java.lang.Thread.run(Thread.java:798)
Caused by: java.lang.RuntimeException: Timeout while waiting for the management service to start up.120 secs.
at com.worklight.core.init.WorklightServletInitializer$1.run(WorklightServletInitializer.java:150)
at com.worklight.core.init.WorklightServletInitializer.initialize(WorklightServletInitializer.java:193)
... 6 more
`
If you are using IBM Java, try instead to install Oracle Java and see if this has gone away.
You can also try removing the MobileFirst Development Server (the folder that appears in your Solution view in Eclipse. Then simply restart Eclipse, this should recreate a fresh copy of the server and the error may be gone then.

java.lang.UnsatisfiedLinkError: cqjnilinuxproxy (Not found in java.library.path)

I have webservices deployed on WAS that use Clearquest jars to connect to Clearquest. At runtime, I get the following errors.
java.lang.Exception: Cannot parse the output since it has an error. Error = ReasonCode = conflictCRVAP0049E (internal-error): Cannot instantiate protocol provider: cqjnilinuxproxy (Not found in java.library.path)
...java.lang.reflect.InvocationTargetException:
at com.ibm.rational.stp.cs.internal.util.StpExceptionImpl.realException(StpExceptionImpl.java:493)
at com.ibm.rational.stp.cs.internal.util.StpExceptionImpl.<init>(StpExceptionImpl.java:572)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
at com.ibm.rational.stp.client.internal.core.ProtocolSubprovider.setProtocolProvider(ProtocolSubprovider.java:614)
... 57 more
Caused by: java.lang.UnsatisfiedLinkError: cqjnilinuxproxy (Not found in java.library.path)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1090)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1054)
at java.lang.System.loadLibrary(System.java:510)
at com.rational.clearquest.cqjni.CQJNIBaseObj.<clinit>(Unknown Source)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:235)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:202)
at com.ibm.rational.stp.client.internal.cqjni.CqJniProtocol.<init>(CqJniProtocol.java:2343)
... 62 more
I followed the technote https://www-304.ibm.com/support/docview.wss?uid=swg21515079 - "An exception occurs on 64-bit WebSphere servers when running reports from ClearQuest data sources that require the Java Native Interface (JNI).
As suggested, WAS 32-bit was installed instead on 64 bit. But the error still occurs. Can you please let me know where this library is or what is going wrong?
Thanks,
Aarthi
The ClearQuest libraries and jars need to be placed on the path so WebSphere can pick them up. Did you source cq_setup.csh prior to starting the WebSphere profile? You would need to source cq_setup.csh and then start the profile in the same shell.

ERROR [main] master.HMasterCommandLine: Master exiting java.lang.RuntimeException: Failed construction of Master

I am getting the below error while trying to run HBASE with HADOOP
HBASE 0.98.x
HADOOP 2.4.0
ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: Failed construction of Master: class org.apache.had$
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMCl$
at org.apache.hadoop.hbase.LocalHBaseCluster.addMaster(LocalHBaseCluste$
at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.j$
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMaste$
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommand$
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandL$
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2793)
Caused by: org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot c$
at org.apache.hadoop.ipc.Client.call(Client.java:1113)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:229)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:245)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedF$
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:144$
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:67)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1464)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:263)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:124)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:247)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:895)
at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:458)
at org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster.<init$
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc$
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating$
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMCl$
... 7 more
Do i have to set configuration property at hbase-site.xml. Thanks in advance
Which version of HBase did you downloaded? Be sure you get the corresponding version with the same hadoop version you have (version 2). On your case you should download
$ wget http://apache.rediris.es/hbase/stable/hbase-0.98.8-hadoop2-bin.tar.gz
instead of
$ wget http://apache.rediris.es/hbase/stable/hbase-0.98.8-hadoop1-bin.tar.gz
Make sure that you are editing the correct files under hbase/conf.

java.lang.UnsatisfiedLinkError: no jinput-linux, when running a my jar artifact

I'm having some issues with a java project in which I use a gamepad controller, thrustmaster firestorm dual analog 3 (usb), under ubuntu 12.04LTS. I know the controller works under ubuntu since I can calibrate and test it. The problem lies on running the jar since I get the following error:
un 04, 2013 9:39:42 AM net.java.games.input.ControllerEnvironment log
INFO: Failed to load library: no jinput-linux in java.library.path
java.lang.UnsatisfiedLinkError: no jinput-linux in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1856)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at net.java.games.input.LinuxEnvironmentPlugin$1.run(LinuxEnvironmentPlugin.java:69)
at java.security.AccessController.doPrivileged(Native Method)
at net.java.games.input.LinuxEnvironmentPlugin.loadLibrary(LinuxEnvironmentPlugin.java:61)
at net.java.games.input.LinuxEnvironmentPlugin.<clinit>(LinuxEnvironmentPlugin.java:102)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:159)
at com.codeminders.ardrone.controllers.ThrustmasterController.initGamepad(ThrustmasterController.java:88)
at com.codeminders.ardrone.controllers.ThrustmasterController.getGamepad(ThrustmasterController.java:79)
at com.codeminders.controltower.ControlTower.initController(ControlTower.java:114)
at com.codeminders.controltower.ControlTower.<init>(ControlTower.java:90)
at com.codeminders.controltower.ControlTower.main(ControlTower.java:591)
Jun 04, 2013 9:39:42 AM net.java.games.input.ControllerEnvironment log
INFO: net.java.games.input.LinuxEnvironmentPlugin is not supported
No gamepad found!
No suitable controller found! Control disabled
Connecting to the drone
Using command port: 1500
I have created the .jar artifact with IDEA, and I think I have included all the libraries in the .jar, but even so, I get that error. I have also tried to execute my .jar like this
java -jar javadrone2.jar -Djava.library.path=/usr/li/libjinput.so
But with the same output... I believe that I have installed the jinput library, because if I type
:$ locate jni
...
/usr/lib/jni
/usr/lib/i386-linux-gnu/jni
/usr/lib/i386-linux-gnu/jni/libatk-wrapper.so
/usr/lib/i386-linux-gnu/jni/libatk-wrapper.so.0
/usr/lib/i386-linux-gnu/jni/libatk-wrapper.so.0.0.18
/usr/lib/i386-linux-gnu/jni/libgnomeproxy-1.0.0.so
/usr/lib/i386-linux-gnu/jni/libpty.so
/usr/lib/i386-linux-gnu/jni/libspawner.so
/usr/lib/jni/libjinput.so
/usr/lib/jni/liblwjgl.so
/usr/lib/jni/libswt-atk-gtk-3833.so
...
:$locate jniput
...
/usr/lib/jni/libjinput.so
/usr/share/java/jinput.jar
...
What can I do to run my .jar??

can't run griffon app

I am trying to run a test app in griffon. I can create the app, but when I go to run it I get the following error(s):
2013-01-25 11:12:02,352 [main] INFO griffon.swing.SwingApplication - Initializing all startup groups: [test1]
2013-01-25 11:12:05,702 [AWT-EventQueue-0] ERROR org.codehaus.griffon.runtime.builder.UberBuilder - An error occurred while building test1.Test1View#63935d75
java.lang.RuntimeException: Failed to create component for 'application' reason: java.awt.HeadlessException
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:97)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this$3$invokeFactoryMethod(UberInterceptorMetaClass.groovy)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass$this$3$invokeFactoryMethod.callCurrent(Unknown Source)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:168)
at test1.Test1View.run(Test1View.groovy:11)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:152)
at org.codehaus.griffon.runtime.builder.UberBuilder.build(UberBuilder.groovy:160)
at org.codehaus.griffon.runtime.core.AbstractMVCGroup$1.run(AbstractMVCGroup.java:129)
Caused by: java.awt.HeadlessException
at griffon.swing.SwingUtils.createApplicationFrame(SwingUtils.java:133)
at griffon.swing.AbstractSwingGriffonApplication.createApplicationContainer(AbstractSwingGriffonApplication.java:99)
at griffon.core.GriffonApplication$createApplicationContainer.call(Unknown Source)
at griffon.swing.factory.ApplicationFactory.newInstance(ApplicationFactory.groovy:54)
... 8 more
2013-01-25 11:12:05,714 [main] ERROR griffon.util.GriffonExceptionHandler - Uncaught Exception
java.lang.RuntimeException: Failed to create component for 'application' reason: java.awt.HeadlessException
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:97)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this$3$invokeFactoryMethod(UberInterceptorMetaClass.groovy)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass$this$3$invokeFactoryMethod.callCurrent(Unknown Source)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:168)
at test1.Test1View.run(Test1View.groovy:11)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:152)
at org.codehaus.griffon.runtime.builder.UberBuilder.build(UberBuilder.groovy:160)
at org.codehaus.griffon.runtime.core.AbstractMVCGroup$1.run(AbstractMVCGroup.java:129)
Caused by: java.awt.HeadlessException
at griffon.swing.SwingUtils.createApplicationFrame(SwingUtils.java:133)
at griffon.swing.AbstractSwingGriffonApplication.createApplicationContainer(AbstractSwingGriffonApplication.java:99)
at griffon.core.GriffonApplication$createApplicationContainer.call(Unknown Source)
at griffon.swing.factory.ApplicationFactory.newInstance(ApplicationFactory.groovy:54)
... 8 more
Any insight you can give would be great.
My set up is:
Kubuntu Linux 12.10 64-bit
------------------------------------------------------------
Griffon 1.2.0
------------------------------------------------------------
Build: 11-Jan-2013 09:10 AM
Groovy: 2.0.6
Ant: 1.8.4
Slf4j: 1.7.2
Spring: 3.2.0.RELEASE
JVM: 1.7.0_09 (Oracle Corporation 23.2-b09)
OS: Linux 3.5.0-22-generic amd64
Thanks!!
ironmantis7x
As mentionioned in the docs at http://docs.oracle.com/javase/6/docs/api/java/awt/HeadlessException.html , this should be a problem with keyboard, mouse or display.
Assuming you did not force "-Djava.awt.headless=true", this is most likely caused by a missing connection to a X-server.
Type
echo $DISPLAY
in a terminal window. Usually this outputs ":0". Make sure that variable is set (happens automatically for terminal windows), and try starting a very basic X application, such as "xterm". If that works, the griffon app should launch and display.
Found it!!!
I needed to have the JRE installed and I didn't. It was looking for a dependency that I needed.

Categories