Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Problems on starting an RCP with EclipseStarter
Problems on starting an RCP with EclipseStarter [message #104711] Mon, 04 February 2008 04:47 Go to next message
Eclipse User
Originally posted by: martin.roth.access.unizh.ch

Hi all,

im running into a strange problem on trying to start an RCP application
by EclipseStarter.

For testing purpose i created a new Project using the wizard containing
an "RCP application with a view". Starting the RCP from within Eclipse
work perfect.

Then i created a product definition based on the working launch
configuration. The exported product works perfect fine - the platform is
started and the window with the dummy perspective is shown. The RCP can
be started using the binary file or using the command

java -jar plugins/org.eclipse.equinox.launcher_xx.jar

Both ways work perfect.

But then, the troubles start - i need to start an RCP from within Java.
For Starting a instance of the platform the use of
org.eclipse.core.runtime.adaptor.EclipseStarter is recommended.

i'm using the following code snippet:

------------------------------------------------------------ ----------------

Map<String, String> initProps = new HashMap<String, String>();

initProps.put("osgi.splashPath", "platform:/base/plugins/testRCP");
// corresponding to generated config.ini

initProps.put("eclipse.product", "testRCP.product");

initProps.put("osgi.clean", "true");
initProps.put("osgi.dev", "true");
initProps.put("osgi.debug", "true");

initProps.put("osgi.install.area", this.installLocation);
initProps.put("osgi.instance.area", this.workspace);
initProps.put("osgi.configuration.area", this.config);


initProps.put("osgi.bundles",
"org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start ,com.ibm.icu,javax.servlet,org.eclipse.core.commands,org.ecl ipse.core.contenttype,org.eclipse.core.databinding,org.eclip se.core.expressions,org.eclipse.core.jobs,org.eclipse.core.r untime.compatibility.auth,org.eclipse.core.runtime.compatibi lity.registry,org.eclipse.equinox.app,org.eclipse.equinox.pr eferences,org.eclipse.equinox.registry,org.eclipse.help,org. eclipse.jface,org.eclipse.jface.databinding,org.eclipse.osgi .services,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,or g.eclipse.ui,org.eclipse.ui.workbench,testRCP,org.eclipse.eq uinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86 ");
initProps.put("osgi.bundles.defaultStartLevel", "4");
// according to config.ini


initProps.put("osgi.user.area", "this.userArea");
initProps.put("osgi.noShutdown", "true");


EclipseStarter.setInitialProperties(initProps);

String[] equinoxArgs = {"-console"};

EclipseStarter.startup(equinoxArgs, null);

------------------------------------------------------------ ---

but i did not manage to get the rcp running. At the end i tried

initProps.put("eclipse.ignoreApp", "true");
initProps.put("eclipse.application.launchDefault", "false");

starting only the osgi-console. the command "apps" gives the following
output:

> testRCP.application [launchable]

but trying to start the rcp with the command
"starApps testRCP.application" fails with the following stack trace:

------------------------------------------------------------ --
osgi> startApp testRCP.application
org.osgi.service.application.ApplicationException
at
org.eclipse.equinox.internal.app.EclipseAppContainer.launch( EclipseAppContainer.java:315)
at
org.eclipse.equinox.internal.app.EclipseAppDescriptor.launch Specific(EclipseAppDescriptor.java:71)
at
org.osgi.service.application.ApplicationDescriptor.launch(Ap plicationDescriptor.java:316)
at
org.eclipse.equinox.internal.app.AppCommands._startApp(AppCo mmands.java:182)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:150)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:291)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:276)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:218)
at java.lang.Thread.run(Unknown Source)

osgi>
---------------------------------------------------------

Unfortunately I can't do see anything helpful in this stacktrace. can
anybody help?

Starting the same application from the same folder using java -jar or
the binary file works fine.. why?

Thanks in advance for your help!
-martin
Re: Problems on starting an RCP with EclipseStarter [message #104936 is a reply to message #104711] Mon, 11 February 2008 05:36 Go to previous message
Eclipse User
Originally posted by: martin.roth.access.unizh.ch

i solved the problem:

for starting starting up the platform and running an application

EclipseStarter.run(equinoxArgs, null);

has to be used. And NOT EclipseStarter.startup(equinoxArgs, null);

cheers martin


Martin Roth schrieb:
> Hi all,
>
> im running into a strange problem on trying to start an RCP application
> by EclipseStarter.
>
> For testing purpose i created a new Project using the wizard containing
> an "RCP application with a view". Starting the RCP from within Eclipse
> work perfect.
>
> Then i created a product definition based on the working launch
> configuration. The exported product works perfect fine - the platform is
> started and the window with the dummy perspective is shown. The RCP can
> be started using the binary file or using the command
>
> java -jar plugins/org.eclipse.equinox.launcher_xx.jar
>
> Both ways work perfect.
>
> But then, the troubles start - i need to start an RCP from within Java.
> For Starting a instance of the platform the use of
> org.eclipse.core.runtime.adaptor.EclipseStarter is recommended.
>
> i'm using the following code snippet:
>
> ------------------------------------------------------------ ----------------
>
>
> Map<String, String> initProps = new HashMap<String, String>();
>
> initProps.put("osgi.splashPath", "platform:/base/plugins/testRCP");
> // corresponding to generated config.ini
>
> initProps.put("eclipse.product", "testRCP.product");
>
> initProps.put("osgi.clean", "true");
> initProps.put("osgi.dev", "true");
> initProps.put("osgi.debug", "true");
>
> initProps.put("osgi.install.area", this.installLocation);
> initProps.put("osgi.instance.area", this.workspace);
> initProps.put("osgi.configuration.area", this.config);
>
>
> initProps.put("osgi.bundles",
> "org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start ,com.ibm.icu,javax.servlet,org.eclipse.core.commands,org.ecl ipse.core.contenttype,org.eclipse.core.databinding,org.eclip se.core.expressions,org.eclipse.core.jobs,org.eclipse.core.r untime.compatibility.auth,org.eclipse.core.runtime.compatibi lity.registry,org.eclipse.equinox.app,org.eclipse.equinox.pr eferences,org.eclipse.equinox.registry,org.eclipse.help,org. eclipse.jface,org.eclipse.jface.databinding,org.eclipse.osgi .services,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,or g.eclipse.ui,org.eclipse.ui.workbench,testRCP,org.eclipse.eq uinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86 ");
>
> initProps.put("osgi.bundles.defaultStartLevel", "4");
> // according to config.ini
>
>
> initProps.put("osgi.user.area", "this.userArea");
> initProps.put("osgi.noShutdown", "true");
>
>
> EclipseStarter.setInitialProperties(initProps);
>
> String[] equinoxArgs = {"-console"};
>
> EclipseStarter.startup(equinoxArgs, null);
>
> ------------------------------------------------------------ ---
>
> but i did not manage to get the rcp running. At the end i tried
>
> initProps.put("eclipse.ignoreApp", "true");
> initProps.put("eclipse.application.launchDefault", "false");
>
> starting only the osgi-console. the command "apps" gives the following
> output:
>
> > testRCP.application [launchable]
>
> but trying to start the rcp with the command
> "starApps testRCP.application" fails with the following stack trace:
>
> ------------------------------------------------------------ --
> osgi> startApp testRCP.application
> org.osgi.service.application.ApplicationException
> at
> org.eclipse.equinox.internal.app.EclipseAppContainer.launch( EclipseAppContainer.java:315)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppDescriptor.launch Specific(EclipseAppDescriptor.java:71)
>
> at
> org.osgi.service.application.ApplicationDescriptor.launch(Ap plicationDescriptor.java:316)
>
> at
> org.eclipse.equinox.internal.app.AppCommands._startApp(AppCo mmands.java:182)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java:150)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:291)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:276)
>
> at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:218)
>
> at java.lang.Thread.run(Unknown Source)
>
> osgi>
> ---------------------------------------------------------
>
> Unfortunately I can't do see anything helpful in this stacktrace. can
> anybody help?
>
> Starting the same application from the same folder using java -jar or
> the binary file works fine.. why?
>
> Thanks in advance for your help!
> -martin
Previous Topic:force OSGi Bundles to start
Next Topic:zipFile.getEntry(path) returns null
Goto Forum:
  


Current Time: Sat Jul 26 11:32:26 EDT 2014

Powered by FUDForum. Page generated in 0.03123 seconds