OdaException - when result set returns zero records
Hi All,
I am using BIRT 2.3.2 in my Project. I have created many reports so far and executed them successfully. I am using Hibernate data source for creating reports. Suddenly i am getting a strange issue in my reports.
Scenario:
User can enter the data from the Front end (xhtml's are used for UI). These data's will be passed to the query as parameters and then the report will be rendered. I am getting the report as i wanted (table , charts with exact data) when the result set of the query returns more than zero record.
Issue:
If the result set of the query returns zero records, then i will get the following exceptions.
org.eclipse.birt.data.engine.odaconsumer.Connection prepareOdaQuery
SEVERE: Cannot prepare statement.
org.eclipse.datatools.connectivity.oda.OdaException
at org.jboss.tools.birt.oda.impl.AbstractOdaFactory.parseQuery(AbstractOdaFactory.java:114)
at org.jboss.tools.birt.oda.impl.AbstractOdaFactory.prepare(AbstractOdaFactory.java:51)
at org.jboss.tools.birt.oda.impl.HibernateOdaQuery.prepare(HibernateOdaQuery.java:45)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.doPrepare(OdaQuery.java:210)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.prepare(OdaQuery.java:167)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareOdaQuery(Connection.java:222)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareStatement(Connection.java:159)
at org.eclipse.birt.data.engine.executor.DataSource.prepareStatement(DataSource.java:309)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:261)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:345)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:331)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:498)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:189)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:177)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:143)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:482)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:115).......................
..........................................................................................................................................................
......................ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
19:28:55,968 ERROR [STDERR] Jul 30, 2009 7:28:55 PM org.eclipse.birt.report.engine.executor.ExtendedGenerateExecutor execute
SEVERE: An exception occurred during processing. Please see the following message for details:
Failed to prepare the following query for the data set type org.jboss.tools.birt.oda.dataSet.
[select sum(loanapp.amount),avg(loanapp.amount),
avg(loanapp.primaryCustomer.creditReport.summary.scoreValue),
count(loanapp.statusHistory.startTime),
month(loanapp.statusHistory.startTime) ,
date(loanapp.statusHistory.startTime),
(select count(la.status) from
LoanApplication la where month(la.statusHistory.startTime) = month(loanapp.statusHistory.startTime)
group by month(la.statusHistory.startTime))
from LoanApplication loanapp where loanapp.status = 'APPROVED' and
loanapp.statusHistory.startTime between ? and ?
group by month(loanapp.statusHistory.startTime)]
org.eclipse.birt.report.data.adapter.api.AdapterException: An exception occurred during processing. Please see the following message for details:
Failed to prepare the following query for the data set type org.jboss.tools.birt.oda.dataSet.
[select sum(loanapp.amount),avg(loanapp.amount),
avg(loanapp.primaryCustomer.creditReport.summary.scoreValue),
count(loanapp.statusHistory.startTime),
month(loanapp.statusHistory.startTime) ,
date(loanapp.statusHistory.startTime),
(select count(la.status) from
LoanApplication la where month(la.statusHistory.startTime) = month(loanapp.statusHistory.startTime)
group by month(la.statusHistory.startTime))
from LoanApplication loanapp where loanapp.status = 'APPROVED' and
loanapp.statusHistory.startTime between ? and ?
group by month(loanapp.statusHistory.startTime)]
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:493)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:115)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:79)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:253)
at org.eclipse.birt.report.engine.executor.ExtendedGenerateExecutor.executeQueries(ExtendedGenerateExecutor.java:204)
at org.eclipse.birt.report.engine.executor.ExtendedGenerateExecutor.execute(ExtendedGenerateExecutor.java:65)
at org.eclipse.birt.report.engine.executor.ExtendedItemExecutor.execute(ExtendedItemExecutor.java:61)..............................
.....................................................................................................................................................................ERROR [STDERR] voke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.birt.data.engine.core.DataException: Failed to prepare the following query for the data set type org.jboss.tools.birt.oda.dataSet.
[select sum(loanapp.amount),avg(loanapp.amount),
avg(loanapp.primaryCustomer.creditReport.summary.scoreValue),
count(loanapp.statusHistory.startTime),
month(loanapp.statusHistory.startTime) ,
date(loanapp.statusHistory.startTime),
(select count(la.status) from
LoanApplication la where month(la.statusHistory.startTime) = month(loanapp.statusHistory.startTime)
group by month(la.statusHistory.startTime))
from LoanApplication loanapp where loanapp.status = 'APPROVED' and
loanapp.statusHistory.startTime between ? and ?
group by month(loanapp.statusHistory.startTime)]
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareOdaQuery(Connection.java:233)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareStatement(Connection.java:159)
at org.eclipse.birt.data.engine.executor.DataSource.prepareStatement(DataSource.java:309)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:261)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:345)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:331)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:498)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:189)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:177)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:143)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:482)
... 74 more
Caused by: org.eclipse.datatools.connectivity.oda.OdaException
at org.jboss.tools.birt.oda.impl.AbstractOdaFactory.parseQuery(AbstractOdaFactory.java:114)
at org.jboss.tools.birt.oda.impl.AbstractOdaFactory.prepare(AbstractOdaFactory.java:51)
at org.jboss.tools.birt.oda.impl.HibernateOdaQuery.prepare(HibernateOdaQuery.java:45)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.doPrepare(OdaQuery.java:210)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.prepare(OdaQuery.java:167)
at org.eclipse.birt.data.engine.odaconsumer.Connection.prepareOdaQuery(Connection.java:222)
... 84 more
It has become very difficult to debug this issue . can some one please help me to resolve this issue.
regards,
ganesh