Home
Analytics
report previews with eclipse, cant get data connected in tomcat
jcas1411
Running tomcat5.5.28/birt 2.5.1/Ubuntu 10.4.
I can successfully run the problem report in eclipse w/birt ( Juno Service Release 1), no errors even pointing to the driver in the tomcat/webapp/birt/WEB-INF/lib directory. I can successfully run the included birt example in tomcat. I'm having issues connecting my reports to db2 in birt viewer 2.5.1.
I have copied into the WEB-INF/lib folder the org.2.eclipse.birt.report.data.oda.jdbc_4.2.1.v20120820 and in its driver folder the ibm db2 drivers. I've also tried making the entire folder a jar so it would load in birt.
This is my first birt report that I have tried to get to work with tomcat.
org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing. Please see the following message for details:
Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: com.ibm.db2.jcc.DB2Driver. (Element ID:1286)
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1237)
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1216)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:96)
at org.eclipse.birt.report.engine.executor.DataItemExecutor.execute(DataItemExecutor.java:75)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
---continued ----
Find more posts tagged with
Comments
CBR
hi,
the mechanism of how you deploy jdbc driver to the webviewer has been changed in BIRT 3.7.
you simply have to copy the jdbc driver jar file into the lib folder. Do not create additional folders there!
You wrote that you are running BIRT 2.5.1 on the server but it seems to be the case that you designed the reports using BIRT 4.2.1
Please keep in mind that you can't run 4.2 reports using some lower version on the server!
jcas1411
Okay, I upgraded my Birt Viewer and engine version to 4.2.1, same as my eclipse version with the report. I copied <br />
<br />
db2jcc.jar and db2jcc_license_cu.jar into WEB-INF\lib folder. I'm now getting the error message below. Do I need to copy any other files into the lib directory? My report has a oda Datasource and several oda-data-sets. To get this to work in Eclipse I put the db2 driver files above in the ~/eclipse/plugins/org.eclipse.birt.report.data.oda.jdbc_4.2.1.v20120820/drivers folder along with other jars from the sqllib/java directory. It seems I'm connecting now but not maintaining the dataset. I used the same query figures with the eclipse run and I get plenty of results with no error. <br />
<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="myDB2db" id="668">
<list-property name="privateDriverProperties">
<ex-property>
<name>contentBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
<ex-property>
<name>metadataBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
<ex-property>
<name>disabledMetadataBidiFormatStr</name>
</ex-property>
<ex-property>
<name>disabledContentBidiFormatStr</name>
</ex-property>
</list-property>
<property name="odaDriverClass">com.ibm.db2.jcc.DB2Driver</property>
<property name="odaURL">jdbc:db2://127.0.0.1:50009/mydb2database</property>
<property name="odaUser">mydbuser</property>
<encrypted-property name="odaPassword" encryptionID="base64">********</encrypted-property>
</oda-data-source>
---snippet---
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="CLIENTS_ACCOUNT" id="1479">
---snippet---
</pre>
Errors...<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
org.eclipse.birt.report.engine.api.EngineException: Cannot fetch the next data row.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot move down to next row in the result set.
SQL error #1:[jcc][t4][10120][10898][3.63.75] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null
;
com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][3.63.75] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null (Element ID:1761)
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1237)
at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1216)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:96)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
</pre>
jcas1411
I am able to run test1.rptdesign. I know it uses the db2 sampledb driver but it is a start.
CBR
That seems to be annoying. I tried to google the error message and found some posts that were saying that the message comes from an incorrect usage of the driver. I m wondering why everything works fine on your machine but not on the server. Can you try a simple stupid report based on your db2 both in eclipse as well as on the server?
jcas1411
I think I might have figured out what is causing the problem, however not sure yet how to fix.
I took your suggestion and attempted to create a new report. Now for back story, I'm not the creator of the birt report or the db2 database, been a mysql, oracle, ms sql guy. We've all been there when our boss told us to get someone else's work running again. I saw it run, plus I can preview in eclipse, all is good there. Now for the ahah moment.
When I started a new report and added my db2 datasource, I only see some of the tables, specifically ones I created and didnt import in using the db2 IX files. Could that be it? I show the imported tables belong to the right schema and the user connecting has all permissions (even did a grant all on the user, still not seeing all the tables). All this time it might be a darn db2 issue.
Thanks!
John
jcas1411
okay, only shows the first 100 tables, had to filter for the specific table I needed and there it was. Pulls data from one table fine. will work on report with param and globals, same as the troubled report.