Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » RCP using declarative services (occasionally) hangs for 30 secs on start-up.
RCP using declarative services (occasionally) hangs for 30 secs on start-up. [message #134192] Fri, 03 July 2009 17:17 Go to next message
Mike Evans is currently offline Mike EvansFriend
Messages: 237
Registered: July 2009
Senior Member
Hi All,
I am experimenting with using OSGi declarative services in a conventional
RCP application.
However when I launch the app within the IDE, it normally hangs for about
30 seconds, waiting for OSGi to start up.
More specifically the while() loop in EclipseStarter.updateSplash() takes
30 seconds or so to acquire the semaphore.
If I remove my declared service by removing the reference to the service
definition xml file in manifest.mf the app starts in about 3 secs –
naturally without the service.
Now here’s the odd bit. If I restore the manifest.mf and re-run,
everything runs beautifully for a few launches, opening service and all in
3 secs or so.
However eventually the app will suddenly again start taking 30 seconds.
Any ideas what might cause this? Any pointers much appreciated.

Service definition:
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
enabled="true" immediate="true" name="Standalone Authentication">
<implementation
class=" uk.org.eoma.ui.application.standalone.internal.StandaloneAut hentication "/>
<service>
<provide
interface="uk.org.eoma.ui.application.security.Authentication "/>
</service>
</scr:component>

Host bundle definition:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: EOMA framework : standalone services
Bundle-SymbolicName: uk.org.eoma.ui.application.standalone;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: uk.org.eoma.ui.application.standalone.internal.Activator
Require-Bundle: org.eclipse.core.runtime,
uk.org.eoma.ui.application;bundle-version="0.1.0",
org.eclipse.equinox.security;bundle-version="1.0.100"
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/service.xml
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Incremental Ltd.

Thanks for your time,

Mike E.

PS : the app is currently a proof-of-concept so if anyone wants the code
(all 3 plug-in’s) you are welcome to it.
Re: RCP using declarative services (occasionally) hangs for 30 secs on start-up. [message #134206 is a reply to message #134192] Fri, 03 July 2009 17:42 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
Mike Evans wrote:
> Hi All,
> I am experimenting with using OSGi declarative services in a
> conventional RCP application. However when I launch the app within the
> IDE, it normally hangs for about 30 seconds, waiting for OSGi to start
> up. More specifically the while() loop in EclipseStarter.updateSplash()
> takes 30 seconds or so to acquire the semaphore.
> If I remove my declared service by removing the reference to the service
> definition xml file in manifest.mf the app starts in about 3 secs �
> naturally without the service.
> Now here�s the odd bit. If I restore the manifest.mf and re-run,
> everything runs beautifully for a few launches, opening service and all
> in 3 secs or so. However eventually the app will suddenly again start
> taking 30 seconds.
> Any ideas what might cause this? Any pointers much appreciated.
>
> Service definition:
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
> enabled="true" immediate="true" name="Standalone Authentication">
> <implementation
> class=" uk.org.eoma.ui.application.standalone.internal.StandaloneAut hentication "/>
>
> <service>
> <provide
> interface="uk.org.eoma.ui.application.security.Authentication "/>
> </service>
> </scr:component>
>
> Host bundle definition:
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: EOMA framework : standalone services
> Bundle-SymbolicName: uk.org.eoma.ui.application.standalone;singleton:=true
> Bundle-Version: 0.1.0.qualifier
> Bundle-Activator: uk.org.eoma.ui.application.standalone.internal.Activator
> Require-Bundle: org.eclipse.core.runtime,
> uk.org.eoma.ui.application;bundle-version="0.1.0",
> org.eclipse.equinox.security;bundle-version="1.0.100"
> Bundle-ActivationPolicy: lazy
> Service-Component: OSGI-INF/service.xml
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
> Bundle-Vendor: Incremental Ltd.
>
> Thanks for your time,
>
> Mike E.
>
> PS : the app is currently a proof-of-concept so if anyone wants the code
> (all 3 plug-in�s) you are welcome to it.

Can you file a bug against RT->Equinox with the sample projects?

DS has a timeout value if it can't get your service.

Can you post the bug here too!

Cheers,

Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
Re: RCP using declarative services (occasionally) hangs for 30 secs on start-up. [message #134518 is a reply to message #134206] Mon, 06 July 2009 18:33 Go to previous messageGo to next message
Mike Evans is currently offline Mike EvansFriend
Messages: 237
Registered: July 2009
Senior Member
Thank you Chris - bug posted:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282563

It *looks* like setting the Run Configuration to 'clear the configuration
area
before launching' might remove the issue but I have not run this long
enough to
be sure.

If so great for development, but my concerns remain for runtime.
I will report back if make any headway myself.

Mike E.
Re: RCP using declarative services (occasionally) hangs for 30 secs on start-up. [message #134683 is a reply to message #134518] Tue, 07 July 2009 15:18 Go to previous message
Mike Evans is currently offline Mike EvansFriend
Messages: 237
Registered: July 2009
Senior Member
July 7 Update (also posted to bug 282563):

Clearing the config data every time is a red herring. This does not
prevent the hangs.
It is definitely a timeout issue with the DS.
I added org.eclipse.equinox.ds tracing and now have the following output
after the delay:

WARNING 30 [SCR] Enabling components of bundle
uk.org.eoma.ui.application.standalone did not complete in 30000 ms

Could this be caused by a (sort of) circular dependency?
To explain:
The bundle u.o.e.u.application.standalone (bundle 'B') has a simple
service definition:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
enabled="true" immediate="true" name="Standalone Authentication">
<implementation
class=" uk.org.eoma.ui.application.standalone.internal.StandaloneAut hentication "/>
<service>
<provide
interface="uk.org.eoma.ui.application.security.Authentication "/>
</service>
</scr:component>

However the bundle itself is dependent on the bundle u.o.e.u.application
(bundle 'A') which supplies the Authentication interface class.
Bundle A also defines a service - which has as a reference back to the
service defined in Bundle B:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
enabled="true" name="Authentication Proxy Binder">
<implementation class="uk.org.eoma.services.proxy.ServiceProxyBinder"/>
<reference name="proxy"

interface=" uk.org.eoma.ui.application.internal.security.AuthenticationP roxy "
bind="bindProxy"
unbind="unbindProxy"
cardinality="0..n"
policy="dynamic" />
<reference name="service"
interface="uk.org.eoma.ui.application.security.Authentication "
bind="setService"
unbind="unsetService"
cardinality="1..1"
policy="dynamic" />
</scr:component>

Thus bundle B requires A to resolved.
But A's service references B's service.
Could this cause a deadlock or the like on OSGi startup?
Previous Topic:org.osgi.framework.BundleException
Next Topic:ServletContext real path in Jetty.
Goto Forum:
  


Current Time: Tue Apr 16 22:42:07 GMT 2024

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

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

Back to the top