1

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 more

Caused 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.

ѕтƒ
  • 3,547
  • 10
  • 47
  • 78
Anuj Kabra
  • 61
  • 1
  • 5
  • There is sonar server and there is the analysis of project using maven plugin. `sonar.properties` is for sonar server. Is sonar server running fine? maven plugin comes into picture later. – Raghuram Nov 26 '11 at 17:26
  • Yes sonar server has started all right and i can see it using oracle dialect in the logs.Database dialect class org.sonar.jpa.dialect.Oracle – Anuj Kabra Dec 02 '11 at 10:15
  • Take a look at this: http://stackoverflow.com/questions/3320400/to-prevent-a-memory-leak-the-jdbc-driver-has-been-forcibly-unregistered – Markos Fragkakis Feb 22 '12 at 09:57

0 Answers0