Sonar plugin fails to execute
Caused by: java.sql.SQLException: SQL driver not found org.apache.derby.jdbc.ClientDriver at org.sonar.jpa.session.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:91) at org.sonar.jpa.session.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:185) ... 42 moreCaused by: java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
When I run sonar maven plugin with -X switch, I can see in the logs the following line:
[DEBUG] To prevent a memory leak, the JDBC Driver [oracle.jdbc.OracleDriver] has been forcibly deregistered
I am assuming this is causing sonar to use org.apache.derby.jdbc.ClientDriver
instead of oracle.jdbc.OracleDriver
which it should as per my configurations. I have commented the lines to deactivate the default embedded derby DB in properties file. My sonar.properties
have following content:
sonar.jdbc.url: jdbc:oracle:thin:@sagarmal05:1521:sonardb
sonar.jdbc.driverClassName: oracle.jdbc.driver.OracleDriver
sonar.jdbc.maxActive: 10
sonar.jdbc.maxIdle: 5
sonar.jdbc.minIdle: 2
sonar.jdbc.maxWait: 5000
sonar.jdbc.minEvictableIdleTimeMillis: 600000
sonar.jdbc.timeBetweenEvictionRunsMillis: 30000
sonar.jdbc.dialect=oracle
Also, I have environment variable set for maven as MAVEN_OPTS=-Xmx700m -XX:MaxPermSize=420m
.
Interesting thing is when I tried to run the sonar execution on other machine the same configurations and same DB, it worked. Only thing different is variable MAVEN_OPTS=-Xmx890m -XX:MaxPermSize=512m
. I can not set it as 890 and 512 on my machine due to memory crunch. If I do maven fails at startup shouting:
Error occurred during initialization of VM. Could not reserve enough space for object heap. Could not create the Java virtual machine.
Help to get me understand what the exact problem is highly appreciated.