Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Report Engine exception in RCP - "platform already running"
Report Engine exception in RCP - "platform already running" [message #195274] Thu, 12 October 2006 20:46 Go to next message
Eclipse User
Originally posted by: xucxuc.gmail.com

Hi All -

I'm using the Report Engine runtime in a RCP client trying to generate
(export) pdf reports. Under 2.0 everything works beautifully. Now when I
try to use the 2.1.1 engine with minimal code change, the following
exception occurs during engine initialization..

ReportEngine engine = new ReportEngine(config);

The exception message:

java.lang.IllegalStateException: Platform already running
at
org.eclipse.core.runtime.adaptor.EclipseStarter.startup(Ecli pseStarter.java:270)
... 10 more


The engine works fine in a standalone application. Is there anything
obvious that I'm missing?

Thanks in advance for any help.
Re: Report Engine exception in RCP - "platform already running" [message #195437 is a reply to message #195274] Fri, 13 October 2006 16:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This error is happening because the new ReportEngine command is trying to
start the platform which is already started.
On the BIRT Wiki there are two RCP examples. Look in the comments section
to get the code for the RCP engine example.

http://wiki.eclipse.org/index.php/RCP_Example


This is what you need to try:
EngineConfig config = new EngineConfig();


// Create the report engine

IReportEngineFactory factory = (IReportEngineFactory) Platform

..createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );

IReportEngine engine = factory.createReportEngine( config );




Jason


"chauncey" <xucxuc@gmail.com> wrote in message
news:54ffa0e9341d2622c1ecedbcfdce2f5a$1@www.eclipse.org...
> Hi All -
>
> I'm using the Report Engine runtime in a RCP client trying to generate
> (export) pdf reports. Under 2.0 everything works beautifully. Now when I
> try to use the 2.1.1 engine with minimal code change, the following
> exception occurs during engine initialization..
>
> ReportEngine engine = new ReportEngine(config);
>
> The exception message:
>
> java.lang.IllegalStateException: Platform already running
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.startup(Ecli pseStarter.java:270)
> ... 10 more
>
>
> The engine works fine in a standalone application. Is there anything
> obvious that I'm missing?
>
> Thanks in advance for any help.
>
Re: Report Engine exception in RCP - "platform already running" [message #195500 is a reply to message #195437] Fri, 13 October 2006 19:39 Go to previous messageGo to next message
Eclipse User
Originally posted by: xucxuc.gmail.com

Thanks, Jason. It works as suggested. One point is that I need to use sdk
plugins instead of just the rumtime library. Since it boils down to plugin
activation, could i still use the rumtime library and activate the plugins
programmatically?
Re: Report Engine exception in RCP - "platform already running" [message #195538 is a reply to message #195500] Sat, 14 October 2006 16:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You shouldnt have to use the sdk plugins, although this is possible.
If you have the framework loaded they are found by the platform by default.
That said, you should be able to launch runtime seperately be specifying a
BIRT home, but
I dont think this is the best way to do it.

Jason

"chauncey" <xucxuc@gmail.com> wrote in message
news:91c8eefe1a608203a62e844d9d4158b3$1@www.eclipse.org...
> Thanks, Jason. It works as suggested. One point is that I need to use sdk
> plugins instead of just the rumtime library. Since it boils down to plugin
> activation, could i still use the rumtime library and activate the plugins
> programmatically?
>
Re: Report Engine exception in RCP - "platform already running" [message #196643 is a reply to message #195538] Thu, 19 October 2006 20:30 Go to previous messageGo to next message
Eclipse User
Originally posted by: xucxuc.gmail.com

Jason -

I still have problem using the runtime libraries from my RCP (with BIRT
home specified and directory structure as below).

eclipse
--birt\
--plugins\
--*.jar
--features\
--plugins\
--product.exe

The lock being the runtime plugins don't get a chance to be loaded by the
platform, leaving the birt Platform instance uninitialized. Thus engine
factory couldn't get constructed as:

IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );

//factory is null

Is there anything i'm missing? Thanks.
Re: Report Engine exception in RCP - "platform already running" [message #196659 is a reply to message #196643] Thu, 19 October 2006 22:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Have you tried to move the birt plugins to your top level plugins directory?

Jason

"chauncey" <xucxuc@gmail.com> wrote in message
news:6050a17766e602351e9e67b475361f8b$1@www.eclipse.org...
> Jason -
>
> I still have problem using the runtime libraries from my RCP (with BIRT
> home specified and directory structure as below).
> eclipse
> --birt\
> --plugins\
> --*.jar
> --features\
> --plugins\
> --product.exe
>
> The lock being the runtime plugins don't get a chance to be loaded by the
> platform, leaving the birt Platform instance uninitialized. Thus engine
> factory couldn't get constructed as:
>
> IReportEngineFactory factory = (IReportEngineFactory)
> Platform.createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>
> //factory is null
>
> Is there anything i'm missing? Thanks.
>
>
Re: Report Engine exception in RCP - "platform already running" [message #196871 is a reply to message #196659] Fri, 20 October 2006 18:41 Go to previous message
Eclipse User
Originally posted by: xucxuc.gmail.com

Jason -

Thanks for the suggestion. It works and I'm also able to use the 'links'
approach and keep the current directory structure.

Thanks for the help~!

Chauncey
Previous Topic:Version 3.2.6 Wrong for BIRT 2.1.0?
Next Topic:java.lang.NoSuchMethodError: org.eclipse.birt.report.model.api.SessionHandle.ope
Goto Forum:
  


Current Time: Sat Oct 25 15:20:23 GMT 2014

Powered by FUDForum. Page generated in 0.03023 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software