Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
java.lang.NullPointerException : ReportEngine.java:794
snair
Hi Experts,
I am new to BIRT and am try to display the rptdesign file in an jsp using this tags
<birt:viewer id="birt" reportDesign="owner.rptdesign"
pattern="frameset"
showTitle="false"
width="1100"
height="400">
</birt:viewer>
I also tried using the java code but i am gettng the same error. The error is :
java.lang.NullPointerException
at org.eclipse.birt.report.engine.api.impl.ReportEngine$EngineExtensionManager.<init>(ReportEngine.java:794)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:105)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:18)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:14)
at cvt.admin.util.AdminUtil.runReport(AdminUtil.java:313)
at org.apache.jsp.admin.testreport_jsp._jspService(testreport_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)
And this error is thrown at this point . org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine.
Does any one have any solutions to solve this issue. Any help will be appreciated.
Regards,
Suj
Find more posts tagged with
Comments
mwilliams
Hi Suj,
I am unable to reproduce this error, even with your same code except for the report design name. Can you post your entire jsp file?
mwilliams
Or post a sample jsp file and sample report where you run into this same error.
snair
Thanks for replies.
I have only that particular code in JSP. I also tried to call that report using java code below.
public void runReport() throws EngineException
{
IReportEngine engine=null;
EngineConfig config = null;
try{
//PlatformConfig platformConfig = new PlatformConfig();
//platformConfig.setBIRTHome("C:CVTworkspacecvtReportEngine");
//Platform.startup( platformConfig );
config = new EngineConfig( );
System.out.println("BEGINNING");
config.setBIRTHome("C:CVTworkspacehaloWebContentWEB-INFReportEngine");
System.out.println("After set birt home : " + config.getBIRTHome());
config.setLogConfig("c:CVT", Level.FINE);
System.out.println(config.getOSGiArguments());
Platform.startup( config );
System.out.println("AFTER STARTUP");
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
System.out.println("AFTER CREATE FACTORY OBJECT " + factory );
if(config == null)
{
System.out.println("CONFIG IS NULL");
}
else
{
System.out.println("CONFIG NOT NULL");
}
engine = factory.createReportEngine( config );
System.out.println("AFTER CREATE REPORT ENGINE");
IReportRunnable design = null;
//Open the report design
System.out.println("BEFORE OPEN REPORT DESIGN");
design = engine.openReportDesign("owner.rptdesign");
System.out.println("AFTER OPEN REPORT DESIGN");
ReportDesignHandle rdh = (ReportDesignHandle)design.getDesignHandle();
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
Map rpMap = new HashMap();
rpMap.put("Top Count", 15);
rpMap.put("Top Percentage", 5);
task.setParameterValues(rpMap);
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("output/resample/TopNPercent.html");
options.setOutputFormat("HTML");
//options.setHtmlRtLFlag(false);
//options.setImageDirectory("output/resample/images");
options.setEnableAgentStyleEngine(true);
options.setEmbeddable(true);
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
finally
{
Platform.shutdown( );
System.out.println("Finished");
}
}
Now i am getting another errror
java.lang.NullPointerException
at org.eclipse.birt.report.engine.api.impl.ReportEngine$EngineExtensionManager.<init>(ReportEngine.java:830)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:109)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:18)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:14)
at org.eclipse.birt.report.service.ReportEngineService.setEngineContext(ReportEngineService.java:331)
at org.eclipse.birt.report.service.BirtViewerReportService.setContext(BirtViewerReportService.java:980)
at org.eclipse.birt.report.servlet.ViewerServlet.__getContext(ViewerServlet.java:148)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:243)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)
This has got something to do with jar files. What ever information i had i have dont the deployment according to it. I am using tomcat as my server and i want to display a report in the jsp page. Any help would be appreciated. I am stuck here for quite some time now
Suj
mwilliams
Suj,
Where are you putting the JSP page? And where is your report design at?
snair
Michael
I have a webcontent folder where all the jsp are placed . And the report file is also placed in the same folder. Is there any specific folder where i need to place this report file ?
Suj
mwilliams
Suj,
I'm not sure that that's your problem, but I put the JSP page in the tomcat/webapps/birt-viewer folder and the report in tomcat/webapps/birt-viewer/report file and call report/reportName.rptdesign in the JSP page. Do you have any issues calling this report not through JSP?
snair
Michael
No, i was able to call the report directly. But am not able to do it through the jsp. Dont know what the problem is.
Suj
mwilliams
Suj,<br />
<br />
Here's my exact JSP page code:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="UTF-8"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<birt:viewer id="birt" reportDesign="report/reportName.rptdesign"
pattern="frameset"
showTitle="false"
width="1100"
height="400">
</birt:viewer>
</body>
</html>
</pre>
<br />
Have you tried placing the JSP page and report design where I suggested? Also, you're using the same runtime as you are designer version correct?
snair
Michael,
Thanks for your help. It worked now. It was all version issues and issues related to jar. I did a redeploy this time more carefully and it worked. Thanks again.
Suj
mwilliams
Suj,
Good to hear. Let us know whenever you have questions.