Birt null pointer exception
config = new EngineConfig();
config.setEngineHome( "C:/birt-runtime-3_7_0/ReportEngine" );
// config.setLogConfig("c:/temp", Level.FINE);
Platform.startup( config ); //If using RE API in Eclipse/RCP application this is not needed.
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
// engine.changeLogLevel( Level.WARNING );
//Open a report design
IReportRunnable design = engine.openReportDesign("C:/birt-runtime-3_7_0/ReportEngine/samples/bookingConfirmationBatch.rptdesign");
IGetParameterDefinitionTask task = engine.createGetParameterDefinitionTask( design );
Collection params = task.getParameterDefns( true );
//Create task to run and render the report,
IRunAndRenderTask task2 = engine.createRunAndRenderTask(design);
-----i am being scheduled!!------
java.lang.NullPointerException
at net.nighttale.scheduling.BookReportGenerator.runBatchReport(BookReportGenerator.java:38)
at net.nighttale.scheduling.SendBookMail.doPost(SendBookMail.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.co开发者_运维技巧re.StandardWrapperValve.invoke(StandardWrapperValv
I'm having the same issue but for what i've understand of Birt 3.7, you don't need to set Birt Home anymore, just copy the jars in ReportEngine/lib and had them to your classpath.
So normally you can remove this line :
config.setEngineHome( "C:/birt-runtime-3_7_0/ReportEngine" );
If you still have NullPointerException, check your permissions.
Hope that helps you.
Edit : i'm not having issue anymore, i was badly packaging my executable jar, now works like a charm ! So i can confirm that you don't need the above line with 3.7 and above.
精彩评论