Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using BIRT 4.2.0 : Build multiple ReportEngine
bognekadje
Happy new year to everyone,<br />
<br />
I am using BIRT 4.2.0 in my web application and i am trying to build multiple ReportEngine in my application. I use following code to create a ReportEngine.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
public static synchronized IReportEngine getReportEngine()
throws Exception {
if (reportEngine == null) {
try {
EngineConfig config = new EngineConfig();
config.setLogConfig(Configuration.BIRT_LOG_DIRECTORY,
getBIRTLogLevel(Configuration.BIRT_LOG_LEVEL));
config.setResourcePath(Configuration.BIRT_RESOURCE_PATH);
config.setLogRollingSize(Configuration.BIRT_LOG_ROLLING_SIZE);
config.setLogMaxBackupIndex(Configuration.BIRT_LOG_MAX_BACKUP_INDEX);
config.getAppContext().put(EngineConstants.WEBAPP_CLASSPATH_KEY,"");
config.getAppContext().put(EngineConstants.APPCONTEXT_DATASET_CACHE_OPTION,true);
config.getAppContext().put(DataEngine.DATASET_CACHE_OPTION,true);
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
if(null == factory){
log.warn("IReportEngineFactory is null");
}
reportEngine = factory.createReportEngine(config);
log.debug("BIRT report engine was created");
} catch (Exception e) {
log.error("BIRT report engine creation failed.");
throw e;
}
if (reportEngine == null) {
log.error("BIRT report engine is null after its creation.");
}
}
return reportEngine;
}
</pre>
<br />
With this code, i got folowing error<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
</pre>
<br />
It is possible to have multiple ReportEngine in an application?<br />
Can someone help me to do that?<br />
<br />
Thanks for your help.<br />
<br />
Eric.
Find more posts tagged with
Comments
mwilliams
Did you download the POJO or OSGi runtime?
bognekadje
Thanks for reply mwilliams,<br />
<br />
I use maven in my project. Dependency of birt is given by following code: <br />
<pre class='_prettyXprint _lang-auto _linenums:0'><dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.2.0</version>
</dependency></pre>
<br />
I do not know what is POJO or OSGI runtime. Can you give more information about or a link to look that?<br />
<br />
Thanks.
mwilliams
If you look at the download page, you'll see that there are two runtime downloads. One is POJO and one is OSGi. The OSGi runtime would require you to set the BIRT_HOME. The POJO runtime just requires that all jars are within your build/classpath. If you were using the OSGi, not setting the BIRT_HOME could cause this error. If using the POJO, setting the BIRT_HOME could cause this issue. Since I don't see it set in your code above, I just thought I'd ask and see if you might have the OSGi runtime.
http://download.eclipse.org/birt/downloads/build.php?build=R-R1-4_2_0-201206131143