Cannot load JDBC Driver class Birt 4.6.0-20160607

Options
Alarm
edited February 11, 2022 in Analytics #1
<p>Hello,</p>
<p> </p>
<p>i am having a Java EE project in which i include the Birt runtime as a maven dependency:<br><br>
 </p>
<pre class="_prettyXprint _lang-xml">
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.6.0-20160607</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.apache.xerces</artifactId>
</exclusion>
<exclusion>
<artifactId>org.apache.poi</artifactId>
<groupId>org.eclipse.birt.runtime</groupId>
</exclusion>
</exclusions>
</dependency>
</pre>
<p>The engine seems to be created (i hope at least) . In my report i have defined the datasource settings.</p>
<pre class="_prettyXprint _lang-xml">
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="somename" id="43">
<list-property name="privateDriverProperties">
<ex-property>
<name>contentBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
<ex-property>
<name>metadataBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
</list-property>
<property name="odaDriverClass">oracle.jdbc.driver.OracleDriver</property>
<property name="odaURL">jdbc:oracle:thin:@host...</property>
<property name="odaUser">username</property>
<encrypted-property name="odaPassword" encryptionID="base64">password</encrypted-property>
</oda-data-source>
</data-sources>
</pre>
<p>Unfortunately it seems that Birt cannot find the ojdbc driver (Note, we use an oracle database)  and we get the following error:</p>
<p> </p>
<blockquote class="ipsBlockquote">
<p> </p>
<p>SEVERE [org.eclipse.birt.data.engine.odaconsumer] (default task-20) Unable to open connection.: org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: oracle.jdbc.driver.OracleDriver.</p>
</blockquote>
<p> </p>
<p>I have included in my Web module under WEB-INF/lib the following jar org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar but i am still getting the same error.</p>
<p> </p>
<p>Is there any way to solve this by adding the ojdbc as a maven dependency or is there any other workaround ?</p>
<p> </p>
<p> </p>
<p> </p>
<p>Update:</p>
<p> </p>
<p>i have tried to also to add the also the org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar as a maven dependency.</p>
<pre class="_prettyXprint _lang-xml">
<!-- Oracle JDBC driver -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>ojdbc</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\main\resources\lib\org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar</systemPath>
</dependency>
</pre>
<p>I am getting the same error. Bellow some part of the stacktrace</p>
<p> </p>
<blockquote class="ipsBlockquote">
<p> </p>
<p> </p>
<p>2017-01-05 13:07:11,990 SEVERE [org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager] (default task-45) DriverClassLoader failed to load class: oracle.jdbc.driver.OracleDriver: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver<br>
    at org.eclipse.birt.core.framework.URLClassLoader.findClass1(URLClassLoader.java:188)</p>
<p>......</p>
<p>......</p>
<p>2017-01-05 13:07:12,020 SEVERE [org.eclipse.birt.data.engine.odaconsumer] (default task-45) Unable to open connection.: org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: oracle.jdbc.driver.OracleDriver.<br>
    at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.findDriver(JDBCDriverManager.java:881)<br>
 </p>
</blockquote>

Comments

  • Alarm
    edited January 5, 2017 #2
    Options
    <p>I  made further changes but still without success.  I added the org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar library in all my modules under WEB-INF and MEtA-INF</p>
    <p> </p>
    <p>\src\main\webapp\WEB-INF\lib\org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122.jar</p>
    <p> </p>
    <p>The results are quite the same:</p>
    <p> </p>
    <blockquote class="ipsBlockquote">
    <p> </p>
    <p>2017-01-05 15:40:49,927 SEVERE [org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager] (default task-19) DriverClassLoader failed to load class: org.eclipse.birt.report.data.oda.jdbc: java.lang.ClassNotFoundException: org.eclipse.birt.report.data.oda.jdbc</p>
    </blockquote>
    <p> </p>
    <p> </p>
    <p>I would also like to note here something. For our persistence in the application, we use a datasource on our wildfly in which we use the ojdbc driver as a module in Wildfly 10 .</p>
    <p> </p>
    <p>I am slowly running out of ideas with Birt + ojdbc</p>
  • <p>Looks like a few more dependencies are needed.</p>
    <p> </p>
    <p>As a test, are you able to use the OSGI version of the Web Viewer?</p>
    <p><a data-ipb='nomediaparse' href='http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4.6.0-201606072112/birt-runtime-osgi-4.6.0-20160607.zip'>http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4.6.0-201606072112/birt-runtime-osgi-4.6.0-20160607.zip</a></p&gt;
    <p> </p>
    <p>You'll find the JDBC "drivers" directory under:</p>
    <p><name of BIRT deployed app -- default is either birt or WebViewerExample>WEB-INF\platform\plugins\org.eclipse.birt.report.data.oda.jdbc_4.6.0.v201606072122\drivers</p>
    Warning No formatter is installed for the format ipb