Home » Eclipse Projects » Eclipse Platform » Problems on starting an RCP with EclipseStarter
Problems on starting an RCP with EclipseStarter [message #324910] |
Mon, 04 February 2008 13:50 |
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 #324929 is a reply to message #324910] |
Mon, 04 February 2008 16:05 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Not sure, but I think you need to specify your application with
-application. Put that in what you call "equinoxArgs" or I think yo can
define it as an eclipse property. From looking at the code, it looks
like it's not finding a default application.
Martin Roth wrote:
> 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
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Re: Problems on starting an RCP with EclipseStarter [message #325003 is a reply to message #324929] |
Tue, 05 February 2008 15:37 |
Eclipse User |
|
|
|
Originally posted by: martin.roth.access.unizh.ch
Hi Francis
thanks for your reply.
putting the argument into the String[] equinoxArgs doesnt' work (altough
it works perfect when using the binary).
if I use the equivalent property "eclipse.application" I end up with the
same situation as described below. apps on osgi-consol gives the
following output:
testRCP.application [running] [not launchable]
so the application is runnable but can't be launched?
I can't find any error messages / log files.. nothing at all (neither in
the workspace nor inside the config directory.
do you have antother idea? can anybody else help? thanks a lot!
Francis Upton schrieb:
> Not sure, but I think you need to specify your application with
> -application. Put that in what you call "equinoxArgs" or I think yo can
> define it as an eclipse property. From looking at the code, it looks
> like it's not finding a default application.
>
> Martin Roth wrote:
>> 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
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 16:13:26 GMT 2024
Powered by FUDForum. Page generated in 0.03310 seconds
|