I changed my Sonar DB from Oracle to Default Derby. I successfully configured the Sonar Server, however I have error during the integration with Hudson.
Caused by: java.sql.SQLException: SQL driver not found oracle.jdbc.OracleDriver
at org.sonar.jpa.session.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:91)
at org.sonar.jpa.session.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:185)
... 41 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.sonar.jpa.session.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:88)
... 42 more
Error states that I can't found OracleDriver, Which I should not use anymore.
In my Hudson configuration, I have removed my oracle configuration and replaced it with these :
Any idea on what I configured wrongly?
fixed by changing the driver to "org.apache.derby.jdbc.ClientDriver". Turns out that the remarks "Do not set if you use default embedded" is a misleading.
Related
we have a project which is not an XA ,currently trying implementing XA implementaion I have followed the following setps for implementation:
in tomee.xml changed the resoure from
<Resource id="paymentsDS" type="javax.sql.DataSource">
to
<Resource id="paymentsDS" type="javax.sql.XADataSource" class-name="com.microsoft.sqlserver.jdbc.SQLServerXADataSource">
and followed the steps same in the provided document : XA with Microsoft SQL Server requires the MS DTC to be configured correctly, and sqljdbc_xa.dll to be installed. For instructions, please see this Microsoft article: https://learn.microsoft.com/en-us/sql/connect/jdbc/understanding-xa-transactions?view=sql-server-2017
In tomcat logs I'm observing Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: REPORT_INSTANCE ,
Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: REPORT_INSTANCE `at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: REPORT_INSTANCE'
but didn't have any hsqlDB I'm using mssql
anyone has idea of resolving the issue and do I need to do any further changes.
We've been using SonarQube for a long time, upgraded over many versions and now executed the long awaited LTS upgrade from version 5.6.6 to 6.7. Unfortunately, the database migration failed due to an SQLException "The table 'project_measures' is full".
Are there any guidelines about what do in such a case?
Is it not okay to upgrade directly from version 5.6.6 to 6.7? Should I first upgrade to some other intermediate version? I thought LTS-to-LTS upgrades should work out fine...
2017.11.15 00:49:38 INFO web[][DbMigrations] #1218 'Delete orphan measures without component': success | time=16143ms
2017.11.15 00:49:38 INFO web[][DbMigrations] #1219 'Make column PROJECT_MEASURES.COMPONENT_UUID not nullable'...
2017.11.15 00:51:04 ERROR web[][DbMigrations] #1219 'Make column PROJECT_MEASURES.COMPONENT_UUID not nullable': failure | time=85651ms
2017.11.15 00:51:04 ERROR web[][DbMigrations] Executed DB migrations: failure | time=1502042ms
2017.11.15 00:51:04 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=1502119ms
2017.11.15 00:51:04 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1219 'Make column PROJECT_MEASURES.COMPONENT_UUID not nullable' failed
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:590)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:50)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Fail to execute ALTER TABLE project_measures MODIFY COLUMN component_uuid VARCHAR (50) NOT NULL
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:97)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:77)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:117)
at org.sonar.server.platform.db.migration.version.v60.MakeComponentUuidNotNullOnMeasures.execute(MakeComponentUuidNotNullOnMeasures.java:40)
at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
... 11 common frames omitted
Caused by: java.sql.SQLException: The table 'project_measures' is full
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2444)
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:82)
... 16 common frames omitted
SonarQube is installed on a RHEL7 host using MySQL (rh-mysql57-mysql-server). The database location is /var/opt/rh/rh-mysql57/lib/mysql/sonar and there is free disk space available (but maybe not enough?):
/dev/mapper/vg0-var_opt 20G 17G 3.1G 85% /var/opt
Upgrade 5.6.6 to 6.7 is supported. According to your stack trace you are using MySQL server.
Can you have a look at server log files and the free space available on MySQL (maybe there is no enough space on your MySQL server for the migration) ?
I'm having an issue connecting to SQL Server 2008R2 using SSL.
jtds driver 1.2.8
jre 1.6.45
sql server 10.50.2500
Connecting in plain text mode works fine:
jdbc:jtds:sqlserver://server01:40033;databaseName=OperationsManagerDW
However connecting in encrypted mode with ssl require property fails:
jdbc:jtds:sqlserver://server01:40033;databaseName=OperationsManagerDW;ssl=require
Notice ssl=require property in JDBC url above.
Applying -Djsse.enableCBCProtection=false setting has no effect.
ava.sql.SQLException: Network error IOException: java.lang.ArrayIndexOutOfBoundsException
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:355)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at SCOMDbConnect.openConnection(SCOMDbConnect.java:347)
at SCOMDbConnect.main(SCOMDbConnect.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: javax.net.ssl.SSLException: java.lang.ArrayIndexOutOfBoundsException
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1708)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1691)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1222)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
at net.sourceforge.jtds.ssl.SocketFactories$TdsTlsSocketFactory.createSocket(SocketFactories.java:102)
at net.sourceforge.jtds.jdbc.SharedSocket.enableEncryption(SharedSocket.java:245)
at net.sourceforge.jtds.jdbc.TdsCore.negotiateSSL(TdsCore.java:509)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:318)
... 11 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at net.sourceforge.jtds.ssl.TdsTlsInputStream.primeBuffer(TdsTlsInputStream.java:109)
at net.sourceforge.jtds.ssl.TdsTlsInputStream.read(TdsTlsInputStream.java:78)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:422)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:460)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
... 16 more
Has anyone similar problems and was able to fix it? I'm thinking of patching SQL server as outlined here https://support.microsoft.com/en-us/kb/2653857/ but it's not clear it would help me.
UPDATE 1: jre 1.6.27 works ok in SSL mode.
Downgrading to jre 1.6.27 up patching JRE solved the issue.
I'm trying to build an application using Play Framework 2.2 and Scala.
I'm not very acquainted to Java environments, so I don't know exactly what's going on.
To make it work with MySql, I should configure my conf/application.conf like this:
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost:3306/sakila"
db.default.user=root
db.default.password="mypass"
Everything seems right to me, but when I try to access it, I get this:
Cannot connect to database [default]
Why? These information are right! The database can be found at localhost:3306/sakila.
What am I doing wrong?
EDIT: Here is my stacktrace. It seems to be missing the mysql connector .jar file, or something like that. What should I do?
[success] Compiled in 734ms
[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sle
eping for 0ms and trying again. Attempts left: 0. Exception: null.Message:No sui
table driver found for mysql://localhost:3306/world
[error] application -
! #6gjp5p29b - Internal server error, for (GET) [/] ->
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [
default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configura
tion.scala:92) ~[play_2.10.jar:2.2.1]
at play.api.Configuration.reportError(Configuration.scala:570) ~[play_2.
10.jar:2.2.1]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252) ~[pla
y-jdbc_2.10.jar:2.2.1]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243) ~[pla
y-jdbc_2.10.jar:2.2.1]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:244) ~[scala-library.jar:na]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:244) ~[scala-library.jar:na]
Caused by: java.sql.SQLException: No suitable driver found for mysql://localhost
:3306/world
at java.sql.DriverManager.getConnection(Unknown Source) ~[na:1.7.0_07]
at java.sql.DriverManager.getConnection(Unknown Source) ~[na:1.7.0_07]
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:363)
~[bonecp.jar:na]
at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416) ~[bonecp.jar:na]
at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.jav
a:120) ~[bonecp.jar:na]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:245) ~[pla
y-jdbc_2.10.jar:2.2.1]
[error] application -
! #6gjp5p29b - Internal server error, for (GET) [/] ->
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [
default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configura
tion.scala:92) ~[play_2.10.jar:2.2.1]
at play.api.Configuration.reportError(Configuration.scala:570) ~[play_2.
10.jar:2.2.1]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252) ~[pla
y-jdbc_2.10.jar:2.2.1]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243) ~[pla
y-jdbc_2.10.jar:2.2.1]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:244) ~[scala-library.jar:na]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:244) ~[scala-library.jar:na]
Caused by: java.sql.SQLException: No suitable driver found for mysql://localhost
:3306/world
at java.sql.DriverManager.getConnection(Unknown Source) ~[na:1.7.0_07]
at java.sql.DriverManager.getConnection(Unknown Source) ~[na:1.7.0_07]
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:363)
~[bonecp.jar:na]
at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416) ~[bonecp.jar:na]
at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.jav
a:120) ~[bonecp.jar:na]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:245) ~[pla
y-jdbc_2.10.jar:2.2.1]
OK, I don't know what's going on.
I put this, and it started to work:
db.default.url="jdbc:mysql://localhost:3306/world"
db.default.driver="com.mysql.jdbc.Driver"
db.default.user="root"
db.default.pass="mypasswrd"
db.default.host="localhost"
Perhaps it needed a more detailed configuration, i just added the db.default.hostconfiguration, stringified everything with "" (I think this is not necessary, but whatever) and checked if mysql was listed in play dependencies listing. Since it was listed there (in fact it was the first entry), and the error didn't say it was a missing library, I just headed to Error when i try connect play with mysql 5.5 and fixed my configurations.
Thanks to everyone!
You need to have the MySQL JDBC driver jar in your dependencies. This page in the documentation shows how to add the derby driver to the dependencies. Substitute the derby coordinates with the MySQL ones.
Tried to connect initial Microsoft SQL Server hibernate session class but got the following error:
Initial SessionFactory creation
failed.org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver com.microsoft.sqlserver.jdbc.SQLServerDriver class not found
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.vaneck.rsutedja.dao.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:17)
at com.vaneck.rsutedja.dao.hibernate.Test.main(Test.java:19)
Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver com.microsoft.sqlserver.jdbc.SQLServerDriver class not found
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:107)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2275)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2271)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1740)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1780)
at com.vaneck.rsutedja.dao.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:13)
... 1 more
Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [com.microsoft.sqlserver.jdbc.SQLServerDriver]
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:146)
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:104)
... 15 more
Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.microsoft.sqlserver.jdbc.SQLServerDriver
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:293)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:143)
... 16 more
Anybody knows how to solve this ?
You should add Microsoft JDBC Driver for SQL Server to your classpath. See:
http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx