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)
IReportEngineFactory is null
getza1
So I have seen a bunch of posts regarding this but none of the answers seem to fix my issue. We have some unit tests setup where we fire up the ReportEngine and just generate a PDF or HTML report to make sure things looks ok. It works on Windows XP and Mac, I just switched my laptop over to Ubuntu 10.4LTS and now I'm getting NullPointerExceptions when trying to create the ReportEngine. <br />
<br />
Some people said that adding the jars in the lib directory of the ReportEngine fixed their issue. We are using Maven and it is adding the correct jars to my classpath when running the JUnit test.<br />
<br />
Some people have said that it is a permissions issue, which might be the case. I changed my java.policy file to contain this line<br />
<br />
grant {<br />
permission java.security.AllPermission;<br />
};<br />
<br />
I'm not really familiar with the Java security stuff so I'm not sure if this is correct or not. The only Exception I'm seeing as well is the NullPointerException so I cannot even confirm that a security exception is being thrown.<br />
<br />
Below is my setup for starting up the ReportEngine. If anyone could help it would be greatly appreciated.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
// create a config
EngineConfig config = new EngineConfig();
String birtHomePath = REPORTS_HOME + "/ear/src/main/application/APP-INF/platform/";
File birtHomeFile = new File(birtHomePath);
if (!birtHomeFile.exists()) {
throw new RuntimeException("Could not find your BIRT home directory: " + birtHomePath);
}
String resourceDirPath = REPORTS_HOME + "/ear/src/main/application/APP-INF/reports/";
File resourceHomeDir = new File(resourceDirPath);
if (!resourceHomeDir.exists()) {
throw new RuntimeException("Could not find your report resource directory: " + resourceDirPath);
}
config.setBIRTHome(birtHomePath);
config.setResourcePath(resourceDirPath);
config.setLogConfig(null, Level.FINE);
// Start the platform
try {
Platform.startup(config);
} catch (BirtException e) {
throw new RuntimeException( "Error starting BIRT engine: " + e.toString() );
}
// get the factory from the platform
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
return factory.createReportEngine(config);
</pre>
<br />
Thanks,<br />
<br />
Aaron
Find more posts tagged with
Comments
JasonW
Aaron,
Does the process that is running BIRT have write access to the birt home location?
Jason