Search code examples
javatomcatjdbcbirt

Birt runtime in tomcat jdbc connection error


I created a report in Birt 4.4.0 and now want to view the report in the birt runtime in my tomcat 8.0.26. The report connects to an Oracle database and works fine in the report designer but when I execute it in the birt runtime I get the following exceptions:

Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: DriverClassLoader failed to load class: oracle.jdbc.driver.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: refreshUrlsWhenFail: true
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: driverClassPath: null
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: Registered URLs: 
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager findDriver
WARNUNG: Failed to load JDBC driver class: oracle.jdbc.driver.OracleDriver
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: DriverClassLoader failed to load class: oracle.jdbc.driver.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: refreshUrlsWhenFail: true
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: driverClassPath: null
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: Registered URLs: 
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager findDriver
WARNUNG: Failed to load JDBC driver class: oracle.jdbc.driver.OracleDriver
Sep 10, 2015 1:05:01 PM org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SCHWERWIEGEND: Unable to open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: oracle.jdbc.driver.OracleDriver.

Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: DriverClassLoader failed to load class: oracle.jdbc.driver.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: refreshUrlsWhenFail: true
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: driverClassPath: null
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: Registered URLs: 
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager findDriver
WARNUNG: Failed to load JDBC driver class: oracle.jdbc.driver.OracleDriver
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: DriverClassLoader failed to load class: oracle.jdbc.driver.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: refreshUrlsWhenFail: true
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: driverClassPath: null
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SCHWERWIEGEND: Registered URLs: 
Sep 10, 2015 1:05:01 PM org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager findDriver
WARNUNG: Failed to load JDBC driver class: oracle.jdbc.driver.OracleDriver
Sep 10, 2015 1:05:01 PM org.eclipse.birt.data.engine.odaconsumer.ConnectionManager openConnection
SCHWERWIEGEND: Unable to open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: oracle.jdbc.driver.OracleDriver.

I put the jdbc .jar in the tomcat's lib folder and in the WEB-INF/lib folder of the birt runtime. Also, the report uses a connection profile.

Hope someone has an idea.


Solution

  • The issue somehow sorted out in the comments - but for anyone landing on this question:

    • you need a jar containing oracle.jdbc.driver.OracleDriver in your Application
    • Search for jars containing that class in google and you will probably land at oracle's driver page (11g release or 12c release or similar). ojdbc6.jar or ojdbc7.jar is probably what you are looking for.
    • for to check, whether you have a correct jar file: rename the jar file to ".zip", extract it, and find OracleDriver.java in the folder oracle/jdbc/driver/. If it exists, then this jar should help you avoid that ClassNotFound exception