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)
Cant Startup the OSGI Framework in BIRT
Prakash.M
***>[Question] Am using Birt_runtime_3_7_2, eclipse indigo and using the following code to render the rptdesign file.
***************************************************************************************
import java.util.logging.Level;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.*;
import com.opensymphony.xwork2.ActionSupport;
public class ExecuteReport extends ActionSupport{
/*
using Birt_runtime_3_7_2, eclipse indigo and using the following code to render the rptdesign file.
*/
public static void main(String args[]) throws EngineException,BirtException
{
EngineConfig config = new EngineConfig( );
config.setBIRTHome("F:/birt-runtime-3_7_2/ReportEngine");
config.setLogConfig("c:/temp", Level.FINE);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine(config);
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("C:/name.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design); /* run and render the design file */
PDFRenderOption options1 = new PDFRenderOption();
options1.setOutputFileName("C:/test.pdf");
options1.setOutputFormat("pdf");
task.setRenderOption(options1);
task.run();
task.close();
engine.destroy();
Platform.shutdown();//shutdown the platform
}
}
*******************************************************************************
Even I ve set java build path. But when am trying to run this program its showing the following exception
*******************************************************************************
Exception in thread "main" org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI framework
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:91)
at ExecuteReport.main(ExecuteReport.java:20)
Caused by: org.eclipse.birt.core.exception.CoreException
at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OSGILauncher.java:90)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:79)
... 1 more
********************************************************************************
>>'But i unable to solve it, Can anybody help me ???'
>>'Thanks in advance'.***
Find more posts tagged with
Comments
JasonW
Remove this line:
config.setBIRTHome("F:/birt-runtime-3_7_2/ReportEngine");
Just make sure all the jars from the ReportEngine/lib are in your classpath.
Jason
Prakash.M
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="109317" data-time="1347560292" data-date="13 September 2012 - 11:18 AM"><p>
Remove this line:<br />
config.setBIRTHome("F:/birt-runtime-3_7_2/ReportEngine");<br />
<br />
Just make sure all the jars from the ReportEngine/lib are in your classpath.<br />
<br />
Jason<br /></p></blockquote>
Prakash.M
Thank you so much JasonW. By Mistaken i ve added some jar files like birt-engineapi,birt-coreapi,etc....
I remove that line and its working properly. In Many forums i ve found the same solution but no one was telling this one, "Should not add any jar files in lib folder of the project". Thank you so muchhhh. :-)
JasonW
Glad you got it working.
Jason