Home » Eclipse Projects » Rich Client Platform (RCP) » Application startup problem in 3.5 with login dialog befor workbench start
| |
Re: Application startup problem in 3.5 with login dialog befor workbench start [message #479992 is a reply to message #479969] |
Thu, 13 August 2009 11:24 |
bjoern Messages: 19 Registered: July 2009 |
Junior Member |
|
|
Hello Wim,
thanks for you quick answer. Up to now I did not know that I can specify
the start level in the product config. Unfortionately this does not help
me. I set the start level of my plugin to 1 and autostart to true in
both the Product config and the run configuration I am launching. In my
tests I set a breakpoint in the activator's and the application's start
method. The Application is started befor the plugin is activated, even
with start level 1 :(
Do you know at what time an application is launched, or should be
launched? Maybe I can somehow tell Eclipse to start the app until the
bundles are started or similar.
Thanks and best Regards,
Björn
Wim Jongman schrieb:
> Hi Bjorn,
>
> I am not completely sure about the lifecycle but you could try to early start
> the required plugins in the product file in the configuration tab.
>
> In the configuration tab there is the possibility to specify which plugins
> need to autostart. You can add the plugins that need to start to the list and
> specify auto-start to true.
>
> If that is not enough you can play with the start level of the plugins. The
> default start level is 4 (osgi.bundles.defaultStartLevel=4 from the generated
> config.ini file) so you can tell your bundle to autostart before the rest.
>
> Best regards,
>
> Wim Jongman
>
> Posted with Salvo, the Eclipse based newsreader.
> http://wiki.eclipse.org/Newsreader
>
>
>> Hello everybody,
>> recently I upgraded my RCP target platform to 3.5 stable. As far as I
>> can see this was the point when my RCP app stopped working :(
>>
>> In the application I use a login dialog that is opened in the
>> Application class _before_ the workbench is started up. The login dialog
>> depends on some plugins that have to be started (more precise, the start
>> method of the Activator must have been executed).
>>
>> Before the update the start order was: The OSGi framework was launched,
>> the bundles were activated. Afterwards the Application's start() mehtod
>> was invoked.
>> After the update it seems that the App's start() mehtod is executed
>> _before_ the bundles are activated, which leads to errors.
>>
>> Has anything changed in startup process from the tooling recently? I
>> suspect a startup option I have not yet found like "Start Bundles prior
>> to launching the Application". I am using a usual run configuration
>> based on a product configuration.
>>
>> I would appreciate any help on that becaus I am slowly going mad on that
>> issue. Thanks for your tips!
>>
>> Regards,
>> Björn
|
|
|
Re: Application startup problem in 3.5 with login dialog befor workbench start [message #479993 is a reply to message #479969] |
Thu, 13 August 2009 11:32 |
bjoern Messages: 19 Registered: July 2009 |
Junior Member |
|
|
An additional Info: I start my application through an "Eclipse
Application" run configuration. I don't know if I can also launch an RCP
app through an "OSGi Framework" run configuration. In this case I would
probably have to find out how the eclipse launcher works and write this
part myself, which seems not very easy to me :(
Regards,
Björn
Wim Jongman schrieb:
> Hi Bjorn,
>
> I am not completely sure about the lifecycle but you could try to early start
> the required plugins in the product file in the configuration tab.
>
> In the configuration tab there is the possibility to specify which plugins
> need to autostart. You can add the plugins that need to start to the list and
> specify auto-start to true.
>
> If that is not enough you can play with the start level of the plugins. The
> default start level is 4 (osgi.bundles.defaultStartLevel=4 from the generated
> config.ini file) so you can tell your bundle to autostart before the rest.
>
> Best regards,
>
> Wim Jongman
>
> Posted with Salvo, the Eclipse based newsreader.
> http://wiki.eclipse.org/Newsreader
>
>
>> Hello everybody,
>> recently I upgraded my RCP target platform to 3.5 stable. As far as I
>> can see this was the point when my RCP app stopped working :(
>>
>> In the application I use a login dialog that is opened in the
>> Application class _before_ the workbench is started up. The login dialog
>> depends on some plugins that have to be started (more precise, the start
>> method of the Activator must have been executed).
>>
>> Before the update the start order was: The OSGi framework was launched,
>> the bundles were activated. Afterwards the Application's start() mehtod
>> was invoked.
>> After the update it seems that the App's start() mehtod is executed
>> _before_ the bundles are activated, which leads to errors.
>>
>> Has anything changed in startup process from the tooling recently? I
>> suspect a startup option I have not yet found like "Start Bundles prior
>> to launching the Application". I am using a usual run configuration
>> based on a product configuration.
>>
>> I would appreciate any help on that becaus I am slowly going mad on that
>> issue. Thanks for your tips!
>>
>> Regards,
>> Björn
|
|
|
Re: Application startup problem in 3.5 with login dialog befor workbench start [message #479999 is a reply to message #479993] |
Thu, 13 August 2009 12:26 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
What I don't get is that bundle who does the login must have some
dependency (require bundle / require package) to the bundles you need
and so OSGi handles the starting for you at the very moment you access
something inside the bundle.
What does ss-tell about started bundles and their state when you launch
with -console are there any errors displayed when launching with
-consoleLog (maybe your Activator is not found, ....)
Another brute force method would be to start the bundles you absolutely
need in the start-method of the IApplication.
Tom
Björn Fischer schrieb:
> An additional Info: I start my application through an "Eclipse
> Application" run configuration. I don't know if I can also launch an RCP
> app through an "OSGi Framework" run configuration. In this case I would
> probably have to find out how the eclipse launcher works and write this
> part myself, which seems not very easy to me :(
>
> Regards,
> Björn
>
> Wim Jongman schrieb:
>> Hi Bjorn,
>>
>> I am not completely sure about the lifecycle but you could try to early start
>> the required plugins in the product file in the configuration tab.
>>
>> In the configuration tab there is the possibility to specify which plugins
>> need to autostart. You can add the plugins that need to start to the list and
>> specify auto-start to true.
>>
>> If that is not enough you can play with the start level of the plugins. The
>> default start level is 4 (osgi.bundles.defaultStartLevel=4 from the generated
>> config.ini file) so you can tell your bundle to autostart before the rest.
>>
>> Best regards,
>>
>> Wim Jongman
>>
>> Posted with Salvo, the Eclipse based newsreader.
>> http://wiki.eclipse.org/Newsreader
>>
>>
>>> Hello everybody,
>>> recently I upgraded my RCP target platform to 3.5 stable. As far as I
>>> can see this was the point when my RCP app stopped working :(
>>>
>>> In the application I use a login dialog that is opened in the
>>> Application class _before_ the workbench is started up. The login dialog
>>> depends on some plugins that have to be started (more precise, the start
>>> method of the Activator must have been executed).
>>>
>>> Before the update the start order was: The OSGi framework was launched,
>>> the bundles were activated. Afterwards the Application's start() mehtod
>>> was invoked.
>>> After the update it seems that the App's start() mehtod is executed
>>> _before_ the bundles are activated, which leads to errors.
>>>
>>> Has anything changed in startup process from the tooling recently? I
>>> suspect a startup option I have not yet found like "Start Bundles prior
>>> to launching the Application". I am using a usual run configuration
>>> based on a product configuration.
>>>
>>> I would appreciate any help on that becaus I am slowly going mad on that
>>> issue. Thanks for your tips!
>>>
>>> Regards,
>>> Björn
|
|
|
Re: Application startup problem in 3.5 with login dialog befor workbench start [message #480012 is a reply to message #479999] |
Thu, 13 August 2009 13:26 |
bjoern Messages: 19 Registered: July 2009 |
Junior Member |
|
|
Hi Tom,
here is a little more precisely my setup. It consists of one plug-in and
an accompanying fragment bundle. The fragment is used for
single-sourcing purposes with RAP, so everything specific to RCP (like
the Application extension point) resides in the fragment. For the
database login I use a RemoteConnectorClass (which communicates with a
server via HTTPInvoker).
The setup looks like this:
Core plug-in
|- Activator.java
|- LoginDialog.java
|- RemoteConnector.java
Core.rcp Fragment bundle
|- MyApplication.java
Now when I run the application, the start() method of MyApplication
opens the LoginDialog. The LoginDialog connects to the server via
RemoteConnector, who depends on Information from the Activator and
assumes that the Activator's start() method was already invoked.
The problem is now that MyApplication#start() is invoked, but never
before was Activator#start(). This is what results in a
NullPointerException in my code, because the Activator should have been
started before. This looks so odd to me and makes me think that I
misconfigured something in the product or the run configuration. But I
just can not find out what!
Maybe you have an idea? Thank you in advance.
Regards,
Björn
P.S.: This is off-topic here, but I want to ask anyway: Is there a
"JFace internals" documentation? I found one concerning the workbench,
but am still searching for JFace source code documentation.
Tom Schindl schrieb:
> Hi,
>
> What I don't get is that bundle who does the login must have some
> dependency (require bundle / require package) to the bundles you need
> and so OSGi handles the starting for you at the very moment you access
> something inside the bundle.
>
> What does ss-tell about started bundles and their state when you launch
> with -console are there any errors displayed when launching with
> -consoleLog (maybe your Activator is not found, ....)
>
> Another brute force method would be to start the bundles you absolutely
> need in the start-method of the IApplication.
>
> Tom
>
> Björn Fischer schrieb:
>> An additional Info: I start my application through an "Eclipse
>> Application" run configuration. I don't know if I can also launch an RCP
>> app through an "OSGi Framework" run configuration. In this case I would
>> probably have to find out how the eclipse launcher works and write this
>> part myself, which seems not very easy to me :(
>>
>> Regards,
>> Björn
>>
>> Wim Jongman schrieb:
>>> Hi Bjorn,
>>>
>>> I am not completely sure about the lifecycle but you could try to early start
>>> the required plugins in the product file in the configuration tab.
>>>
>>> In the configuration tab there is the possibility to specify which plugins
>>> need to autostart. You can add the plugins that need to start to the list and
>>> specify auto-start to true.
>>>
>>> If that is not enough you can play with the start level of the plugins. The
>>> default start level is 4 (osgi.bundles.defaultStartLevel=4 from the generated
>>> config.ini file) so you can tell your bundle to autostart before the rest.
>>>
>>> Best regards,
>>>
>>> Wim Jongman
>>>
>>> Posted with Salvo, the Eclipse based newsreader.
>>> http://wiki.eclipse.org/Newsreader
>>>
>>>
>>>> Hello everybody,
>>>> recently I upgraded my RCP target platform to 3.5 stable. As far as I
>>>> can see this was the point when my RCP app stopped working :(
>>>>
>>>> In the application I use a login dialog that is opened in the
>>>> Application class _before_ the workbench is started up. The login dialog
>>>> depends on some plugins that have to be started (more precise, the start
>>>> method of the Activator must have been executed).
>>>>
>>>> Before the update the start order was: The OSGi framework was launched,
>>>> the bundles were activated. Afterwards the Application's start() mehtod
>>>> was invoked.
>>>> After the update it seems that the App's start() mehtod is executed
>>>> _before_ the bundles are activated, which leads to errors.
>>>>
>>>> Has anything changed in startup process from the tooling recently? I
>>>> suspect a startup option I have not yet found like "Start Bundles prior
>>>> to launching the Application". I am using a usual run configuration
>>>> based on a product configuration.
>>>>
>>>> I would appreciate any help on that becaus I am slowly going mad on that
>>>> issue. Thanks for your tips!
>>>>
>>>> Regards,
>>>> Björn
|
|
|
Re: Application startup problem in 3.5 with login dialog befor workbench start [message #480352 is a reply to message #480012] |
Sat, 15 August 2009 20:05 |
Wim Jongman Messages: 423 Registered: July 2009 |
Senior Member |
|
|
Hi Bjorn,
i have searched a good hour on the net finding something lifecycle related.
One might think a proper sequence diagram is the least of the documents but I
could not find it. There is some information about the workbench lifecycle.
When I was searching the online docs on the IApplication model I found
Platform Plug-in Developer Guide > Programmer's Guide > Runtime overview >
Runtime application model. Which points to the OSGi specifications. You have
to look at the OSGi Service Platform Release 4 Version 4.1 Compendium
Specification to find information about OSGi applications.
Sounds overly complicated to find something basic as the lifecycle. I tried
to quickly understand the specs on item 116 which deals with the application.
It sounds logical to me that the Application executable gets control first
before any bundles are started. Maybe you should move your login code to the
Activator instead of the Application.
I would definitly file a bug to get this case cleared up.
Best regards,
Wim
> Hi Tom,
> here is a little more precisely my setup. It consists of one plug-in and
> an accompanying fragment bundle. The fragment is used for
> single-sourcing purposes with RAP, so everything specific to RCP (like
> the Application extension point) resides in the fragment. For the
> database login I use a RemoteConnectorClass (which communicates with a
> server via HTTPInvoker).
>
> The setup looks like this:
>
> Core plug-in
> |- Activator.java
> |- LoginDialog.java
> |- RemoteConnector.java
>
> Core.rcp Fragment bundle
> |- MyApplication.java
>
> Now when I run the application, the start() method of MyApplication
> opens the LoginDialog. The LoginDialog connects to the server via
> RemoteConnector, who depends on Information from the Activator and
> assumes that the Activator's start() method was already invoked.
>
> The problem is now that MyApplication#start() is invoked, but never
> before was Activator#start(). This is what results in a
> NullPointerException in my code, because the Activator should have been
> started before. This looks so odd to me and makes me think that I
> misconfigured something in the product or the run configuration. But I
> just can not find out what!
>
> Maybe you have an idea? Thank you in advance.
>
> Regards,
> Bj
|
|
|
Re: Application startup problem in 3.5 with login dialog befor workbench start [message #482024 is a reply to message #480352] |
Tue, 25 August 2009 07:37 |
bjoern Messages: 19 Registered: July 2009 |
Junior Member |
|
|
Hi Wim,
after a week of vacation I had the free mind to find my problem.
The problem was that I did not check the option "Activate this plug-in
when one of its classes is loaded" in the manifest editor
("Bundle-ActivationPolicy: lazy" in manifest.mf). I do not know why this
was a problem so suddenly, but setting this option on all of my plug-ins
did the trick.
Maybe someone on the newsgroup can estimate if this is a bug or a
feature. Anyway, it works and that makes me happy :)
Best regards,
Björn
Wim Jongman schrieb:
> Hi Bjorn,
>
> i have searched a good hour on the net finding something lifecycle related.
> One might think a proper sequence diagram is the least of the documents but I
> could not find it. There is some information about the workbench lifecycle.
>
> When I was searching the online docs on the IApplication model I found
> Platform Plug-in Developer Guide > Programmer's Guide > Runtime overview >
> Runtime application model. Which points to the OSGi specifications. You have
> to look at the OSGi Service Platform Release 4 Version 4.1 Compendium
> Specification to find information about OSGi applications.
>
> Sounds overly complicated to find something basic as the lifecycle. I tried
> to quickly understand the specs on item 116 which deals with the application.
> It sounds logical to me that the Application executable gets control first
> before any bundles are started. Maybe you should move your login code to the
> Activator instead of the Application.
>
> I would definitly file a bug to get this case cleared up.
>
> Best regards,
>
> Wim
>
>
>> Hi Tom,
>> here is a little more precisely my setup. It consists of one plug-in and
>> an accompanying fragment bundle. The fragment is used for
>> single-sourcing purposes with RAP, so everything specific to RCP (like
>> the Application extension point) resides in the fragment. For the
>> database login I use a RemoteConnectorClass (which communicates with a
>> server via HTTPInvoker).
>>
>> The setup looks like this:
>>
>> Core plug-in
>> |- Activator.java
>> |- LoginDialog.java
>> |- RemoteConnector.java
>>
>> Core.rcp Fragment bundle
>> |- MyApplication.java
>>
>> Now when I run the application, the start() method of MyApplication
>> opens the LoginDialog. The LoginDialog connects to the server via
>> RemoteConnector, who depends on Information from the Activator and
>> assumes that the Activator's start() method was already invoked.
>>
>> The problem is now that MyApplication#start() is invoked, but never
>> before was Activator#start(). This is what results in a
>> NullPointerException in my code, because the Activator should have been
>> started before. This looks so odd to me and makes me think that I
>> misconfigured something in the product or the run configuration. But I
>> just can not find out what!
>>
>> Maybe you have an idea? Thank you in advance.
>>
>> Regards,
>> Björn
>>
>> P.S.: This is off-topic here, but I want to ask anyway: Is there a
>> "JFace internals" documentation? I found one concerning the workbench,
>> but am still searching for JFace source code documentation.
>>
>>
>> Tom Schindl schrieb:
>>> Hi,
>>>
>>> What I don't get is that bundle who does the login must have some
>>> dependency (require bundle / require package) to the bundles you need
>>> and so OSGi handles the starting for you at the very moment you access
>>> something inside the bundle.
>>>
>>> What does ss-tell about started bundles and their state when you launch
>>> with -console are there any errors displayed when launching with
>>> -consoleLog (maybe your Activator is not found, ....)
>>>
>>> Another brute force method would be to start the bundles you absolutely
>>> need in the start-method of the IApplication.
>>>
>>> Tom
>>>
>>> Björn Fischer schrieb:
>>>> An additional Info: I start my application through an "Eclipse
>>>> Application" run configuration. I don't know if I can also launch an RCP
>>>> app through an "OSGi Framework" run configuration. In this case I would
>>>> probably have to find out how the eclipse launcher works and write this
>>>> part myself, which seems not very easy to me :(
>>>>
>>>> Regards,
>>>> Björn
>>>>
>>>> Wim Jongman schrieb:
>>>>> Hi Bjorn,
>>>>>
>>>>> I am not completely sure about the lifecycle but you could try to early
> start
>>>>> the required plugins in the product file in the configuration tab.
>>>>>
>>>>> In the configuration tab there is the possibility to specify which
> plugins
>>>>> need to autostart. You can add the plugins that need to start to the
> list and
>>>>> specify auto-start to true.
>>>>>
>>>>> If that is not enough you can play with the start level of the plugins.
> The
>>>>> default start level is 4 (osgi.bundles.defaultStartLevel=4 from the
> generated
>>>>> config.ini file) so you can tell your bundle to autostart before the
> rest.
>>>>> Best regards,
>>>>>
>>>>> Wim Jongman
>>>>>
>>>>> Posted with Salvo, the Eclipse based newsreader.
>>>>> http://wiki.eclipse.org/Newsreader
>>>>>
>>>>>
>>>>>> Hello everybody,
>>>>>> recently I upgraded my RCP target platform to 3.5 stable. As far as I
>>>>>> can see this was the point when my RCP app stopped working :(
>>>>>>
>>>>>> In the application I use a login dialog that is opened in the
>>>>>> Application class _before_ the workbench is started up. The login
> dialog
>>>>>> depends on some plugins that have to be started (more precise, the
> start
>>>>>> method of the Activator must have been executed).
>>>>>>
>>>>>> Before the update the start order was: The OSGi framework was launched,
>>>>>> the bundles were activated. Afterwards the Application's start() mehtod
>>>>>> was invoked.
>>>>>> After the update it seems that the App's start() mehtod is executed
>>>>>> _before_ the bundles are activated, which leads to errors.
>>>>>>
>>>>>> Has anything changed in startup process from the tooling recently? I
>>>>>> suspect a startup option I have not yet found like "Start Bundles prior
>>>>>> to launching the Application". I am using a usual run configuration
>>>>>> based on a product configuration.
>>>>>>
>>>>>> I would appreciate any help on that becaus I am slowly going mad on
> that
>>>>>> issue. Thanks for your tips!
>>>>>>
>>>>>> Regards,
>>>>>> Björn
|
|
| | |
Goto Forum:
Current Time: Sat Jan 18 21:46:41 GMT 2025
Powered by FUDForum. Page generated in 0.03461 seconds
|