[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[birt-dev] Null Pointer exception while executing the RUN task.
|
We have written a cutomized viewer for BIRT reports and the RUN task is being
executed by using the following code. The BIRT version we are using is
2.2.1.
IReportEngine reportEngine = BirtEngine.getBirtEngine(getContext());
String requestedPageNumber =
ReportsHelper.getRequestParameter(getRequest(),
ReportsHelper.PARAM_PAGE_NUMBER);
Long requestId =
Long.valueOf(ReportsHelper.getRequestParameter(getRequest(),
ReportsHelper.PARAM_REQUEST_ID));
long reportDocumentMaxPageNumber = 0;
if (ReportsHelper.isEmpty(requestedPageNumber)) {
requestedPageNumber = DEFAULT_PAGE_NUMBER;
ReportsLog.debug(this, "Paramter " + ReportsHelper.PARAM_PAGE_NUMBER + "
not found. Setting the page number to the default page number [" +
DEFAULT_PAGE_NUMBER + "]");
} else {
try {
reportDocumentMaxPageNumber =
reportEngine.openReportDocument(ReportsHelper.getReportDocumentURL(request,
requestId)).getPageCount();
} catch (EngineException e) {
ReportsLog.error(this, "Error opening the report design and getting the
maximun of page numbers in the report document.", e);
throw e;
}
}
IRunTask runTask = null;
try {
if (Long.parseLong(requestedPageNumber) > reportDocumentMaxPageNumber) {
runTask = reportEngine.createRunTask(reportRunnable);
runTask.getAppContext().put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST,
request);
runTask.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
BaseReportExecutor.class.getClassLoader());
runTask.setParameterValues(getParameterValues(getRequest(),
(ReportDesignHandle) reportRunnable.getDesignHandle()));
if
(ReportsHelper.OUTPUT_FORMAT_HTML.equals(ReportsHelper.getRequestParameter(getRequest(),ReportsHelper.PARAM_RENDER_AS)))
{
// If the requested format is HTML then set the page handler
// to the requested page number.
runTask.setPageHandler(new PageHandler(runTask,
Integer.valueOf(requestedPageNumber), requestId));
}
runTask.run(ReportsHelper.getReportDocumentURL(getRequest(),
requestId));
runTask.close();
}
We the RUN task is executed it gives the following exception.
SEVERE: An error happened while running the report. Cause:
java.lang.NullPointerException
at java.util.logging.Logger.entering(Logger.java:859)
at
org.eclipse.birt.data.engine.impl.aggregation.AggregateTable.<init>(AggregateTable.java:46)
at
org.eclipse.birt.data.engine.impl.aggregation.AggregateTable.<init>(AggregateTable.java:60)
at
org.eclipse.birt.data.engine.impl.PreparedQuery.<init>(PreparedQuery.java:115)
at
org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.<init>(PreparedDataSourceQuery.java:75)
at
org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.<init>(PreparedOdaDSQuery.java:61)
at
org.eclipse.birt.data.engine.impl.PreparedQueryUtil.newInstance(PreparedQueryUtil.java:125)
at
org.eclipse.birt.data.engine.impl.DataEngineImpl.prepare(DataEngineImpl.java:396)
at
org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.prepare(DataRequestSessionImpl.java:305)
at
org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.prepare(DataRequestSessionImpl.java:464)
at
org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doPrepareQuery(DataGenerationEngine.java:94)
at
org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.prepare(AbstractDataEngine.java:138)
at
org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:94)
at
org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:59)
at
org.eclipse.birt.report.engine.internal.executor.emitter.ReportEmitterExecutor.execute(ReportEmitterExecutor.java:76)
at
org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(WrappedReportExecutor.java:59)
at
org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.execute(SuppressDuplciateReportExecutor.java:51)
at
org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:187)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:224)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:89)
at
com.secretseal.atlasreports.framework.executor.BaseReportExecutor.executeReport(BaseReportExecutor.java:108)
at
com.secretseal.atlasreports.framework.engine.AtlasReportGenerator.executeReport(AtlasReportGenerator.java:95)
at
com.secretseal.atlasreports.framework.engine.ReportGeneratorWorkshop.generateReport(ReportGeneratorWorkshop.java:39)
at
com.secretseal.atlasreports.framework.servlets.ProgressiveReportViewerBodyServlet.doGet(ProgressiveReportViewerBodyServlet.java:72)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Can any body tell me why is this happening?
--
View this message in context: http://www.nabble.com/Null-Pointer-exception-while-executing-the-RUN-task.-tp15229218p15229218.html
Sent from the Eclipse BIRT - Dev mailing list archive at Nabble.com.