I've just got it working as a Glassfish v3 osgi bundle, so it should
work under other felix containers. I used the following code:

                EngineConfig config = new EngineConfig();
        
config.setEngineHome("C:/java/birt-runtime-2_5_1/ReportEngine");
                ReportEngine engine = new ReportEngine(config);
                InputStream is = getClass().getResourceAsStream(
                                "example.rptdesign");
                try {
                        IReportRunnable reportRunnable = engine
                                        .openReportDesign(is);
                        IRunAndRenderTask task = engine
        
.createRunAndRenderTask(reportRunnable);
                        task.getAppContext().put(
        
EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
                                        getClass().getClassLoader());

                        PDFRenderOption options = new PDFRenderOption();
        
options.setOutputFileName("c:/target/example.pdf");
                        options.setOutputFormat("pdf");

                        task.setRenderOption(options);

                        task.run();
                        task.close();
                        engine.destroy();
                } catch (EngineException e) {
                        log.log(Level.SEVERE, e.getMessage(), e);
                }

I've created one bundle with the BIRT ReportEngine/lib folder jars and
exported the API packages. I'm accessing that from another bundle with
the above code.
Hope that helps.

Nick
 

-----Original Message-----
From: shogo [mailto:[email protected]] 
Sent: 22 January 2010 12:19
To: [email protected]
Subject: Eclipse BIRT as felix bundle


Is this possible ? Anyone tryied ?
When i'am trying to run birt on felix i'm getting an error.

My code:
EngineConfig config = new EngineConfig();
config.setEngineHome("ReportEngine");
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGIN
E_FACTORY);

factory is not created. It looks like birt cant find his plugins.
Any ideas ?

-- 
View this message in context:
http://old.nabble.com/Eclipse-BIRT-as-felix-bundle-tp27272395p27272395.h
tml
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to