Home
Analytics
sporadic mysql driver failure
johnrellis
Hi all,
I have wrote a Java class to deploy a birt report to a specified directory in html format. It is pretty much a carbon copy of that found on the BIRT Eclipse wiki. The class will work fine when i run it once, however if i put it within a for loop and run it more than once within the loop, all but the first one fails with the exception:
"03-Jun-2008 10:38:08 org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager findDriver
WARNING: Failed to load JDBC driver class: com.mysql.jdbc.Driver
03-Jun-2008 10:38:08 org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SEVERE: Cannot open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: com.mysql.jdbc.Driver"
The fact that the database driver is found first time suggests to me that all is set up correctly on my machine, i could be suffering from code blindness as i have read over the class so many times but i cant see anything wrong. I have attached the class and a test report that uses the classic models database that should reproduce the error. If anyone could take a look and give me some feedback that would be great. Any help is as always greatly appreciated! I have comments in the main method that hopefully make it easy to run!
Thanks,
John
Find more posts tagged with
Comments
johnrellis
Driver failure is not occurring in 2.3
cypherdj
John,
there is a major difference between how birt 2.2 and 2.3 handle JDBC drivers.
In the 2.2 framework, you need to specifically copy your JDBC driver jar into the following location:
WEB-INFplatformpluginsorg.eclipse.birt.report.data.oda.jdbc_2.2.2.r22x_v20071206drivers
In the 2.3 framework, the drivers are retrieved from the classpath.
This would explain why you resolved the issue in 2.3 I believe.
Hope that helps,
Cedric
johnrellis
Thanks for the information!