You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Adrián Roselló Rey <ad...@i2cat.net> on 2014/04/16 10:26:08 UTC

ServiceUnavailableException

Hi all,

I have an OSGI application in which I use Aries Bluepint to publish my
services. My scenario consists of two bundles: bundle A publishes serviceA
and bundleB publish serviceB, in which serviceA is injected:

*Bundle A / blueprint.xml*



*<bean id="serviceA" class="blabla.ServiceAImpl"/><service ref="serviceA"
interface="blabla.ServiceA"> </service>*

*Bundle B / blueprint.xml*

*<reference id="serviceA" interface="blabla.ServiceA"/>*





*<bean id="serviceB" class="blabla.ServiceBImpl">        <property
name="serviceA" ref="serviceA" /> </bean>  <service ref="serviceB"
interface="blabla.ServiceB"> </service>*


Sometimes, when deploying my application (and also when testing) I get the
following error:

Caused by:
org.osgi.service.blueprint.container.ServiceUnavailableException: The
Blueprint container is being or has been destroyed:
(objectClass=blabla.ServiceA)
    at
org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:240)
    at
org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:55)
    at
org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:298)
    at Proxy1e317e77_0693_41e9_8bcb_60a2dbe3386c.getName(Unknown Source)
    at blabla.ServiceBImpl.getServiceA(ServiceBImpl.java:99)
    ... 47 more

Any idea on what could be happening?

Thanks!

Best regards,

-- 




* Adrián Roselló Rey Distributed Applications and Networks Area (DANA)
i2CAT Foundation, Barcelona, Spain*
T: +34 93 553 25 49
http://dana.i2cat.net

RE: ServiceUnavailableException

Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
The problem may arise when for some reason Bundle A is restarted. Starting or restarting Bundle B has no impact on Bundle A lifecycle.

Do you have a simple scenario to reproduce this issue? Does it appear when you start your OSGi container (Karaf?)?

JP

[@@ OPEN @@]

De : Adrián Roselló Rey [mailto:adrian.rosello@i2cat.net]
Envoyé : mercredi 16 avril 2014 10:48
À : user
Objet : Re: ServiceUnavailableException

Hi Jean-Philippe
Thanks for your quick answer. What you say makes sense, but I'm not sure why Bundle A should be restarted. If I install Bundle B after bundle A, and Bundle B depends on Bundle A, bundle B is restarted?


2014-04-16 10:39 GMT+02:00 CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>>:
Hi Adrián,

I'm not too sure if it is related but from your blueprint samples ServiceBImpl might refer to a ServiceA which is not available anymore when Bundle A is restarted. Could it be the case?

Regards,
JP

[@@ OPEN @@]

De : Adrián Roselló Rey [mailto:adrian.rosello@i2cat.net<ma...@i2cat.net>]
Envoyé : mercredi 16 avril 2014 10:26
À : user@aries.apache.org<ma...@aries.apache.org>
Objet : ServiceUnavailableException

Hi all,
I have an OSGI application in which I use Aries Bluepint to publish my services. My scenario consists of two bundles: bundle A publishes serviceA and bundleB publish serviceB, in which serviceA is injected:
Bundle A / blueprint.xml

<bean id="serviceA" class="blabla.ServiceAImpl"/>
<service ref="serviceA" interface="blabla.ServiceA">
</service>
Bundle B / blueprint.xml

<reference id="serviceA" interface="blabla.ServiceA"/>

<bean id="serviceB" class="blabla.ServiceBImpl">
        <property name="serviceA" ref="serviceA" />
 </bean>
 <service ref="serviceB" interface="blabla.ServiceB">
 </service>

Sometimes, when deploying my application (and also when testing) I get the following error:

Caused by: org.osgi.service.blueprint.container.ServiceUnavailableException: The Blueprint container is being or has been destroyed: (objectClass=blabla.ServiceA)
    at org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:240)
    at org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:55)
    at org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:298)
    at Proxy1e317e77_0693_41e9_8bcb_60a2dbe3386c.getName(Unknown Source)
    at blabla.ServiceBImpl.getServiceA(ServiceBImpl.java:99)
    ... 47 more
Any idea on what could be happening?

Thanks!
Best regards,

--
[http://www.i2cat.net/sites/all/themes/elegantica/logo.png]
Adrián Roselló Rey
Distributed Applications and Networks Area (DANA)
i2CAT Foundation, Barcelona, Spain
T: +34 93 553 25 49<tel:%2B34%2093%20553%2025%2049>
http://dana.i2cat.net



--
[http://www.i2cat.net/sites/all/themes/elegantica/logo.png]
Adrián Roselló Rey
Distributed Applications and Networks Area (DANA)
i2CAT Foundation, Barcelona, Spain
T: +34 93 553 25 49
http://dana.i2cat.net

Re: ServiceUnavailableException

Posted by Adrián Roselló Rey <ad...@i2cat.net>.
Hi Jean-Philippe

Thanks for your quick answer. What you say makes sense, but I'm not sure
why Bundle A should be restarted. If I install Bundle B after bundle A, and
Bundle B depends on Bundle A, bundle B is restarted?




2014-04-16 10:39 GMT+02:00 CLEMENT Jean-Philippe <
jean-philippe.clement@fr.thalesgroup.com>:

> Hi Adrián,
>
>
>
> I'm not too sure if it is related but from your blueprint samples
> ServiceBImpl might refer to a ServiceA which is not available anymore when
> Bundle A is restarted. Could it be the case?
>
>
>
> Regards,
>
> JP
>
>
>
> [@@ OPEN @@]
>
>
>
> *De :* Adrián Roselló Rey [mailto:adrian.rosello@i2cat.net]
> *Envoyé :* mercredi 16 avril 2014 10:26
> *À :* user@aries.apache.org
> *Objet :* ServiceUnavailableException
>
>
>
> Hi all,
>
> I have an OSGI application in which I use Aries Bluepint to publish my
> services. My scenario consists of two bundles: bundle A publishes serviceA
> and bundleB publish serviceB, in which serviceA is injected:
>
> *Bundle A / blueprint.xml*
>
>
>
> *<bean id="serviceA" class="blabla.ServiceAImpl"/><service ref="serviceA"
> interface="blabla.ServiceA"> </service>*
>
> *Bundle B / blueprint.xml*
>
> *<reference id="serviceA" interface="blabla.ServiceA"/>*
>
>
>
>
>
> *<bean id="serviceB" class="blabla.ServiceBImpl">         <property
> name="serviceA" ref="serviceA" /> </bean> <service ref="serviceB"
> interface="blabla.ServiceB"> </service>*
>
>
>
> Sometimes, when deploying my application (and also when testing) I get the
> following error:
>
> Caused by:
> org.osgi.service.blueprint.container.ServiceUnavailableException: The
> Blueprint container is being or has been destroyed:
> (objectClass=blabla.ServiceA)
>     at
> org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:240)
>     at
> org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:55)
>     at
> org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:298)
>     at Proxy1e317e77_0693_41e9_8bcb_60a2dbe3386c.getName(Unknown Source)
>     at blabla.ServiceBImpl.getServiceA(ServiceBImpl.java:99)
>     ... 47 more
>
> Any idea on what could be happening?
>
> Thanks!
>
> Best regards,
>
>
> --
>
>
>
>
> * Adrián Roselló ReyDistributed Applications and Networks Area (DANA)i2CAT
> Foundation, Barcelona, Spain*
>
> T: +34 93 553 25 49
>
> http://dana.i2cat.net
>



-- 




* Adrián Roselló Rey Distributed Applications and Networks Area (DANA)
i2CAT Foundation, Barcelona, Spain*
T: +34 93 553 25 49
http://dana.i2cat.net

RE: ServiceUnavailableException

Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Hi Adrián,

I'm not too sure if it is related but from your blueprint samples ServiceBImpl might refer to a ServiceA which is not available anymore when Bundle A is restarted. Could it be the case?

Regards,
JP

[@@ OPEN @@]

De : Adrián Roselló Rey [mailto:adrian.rosello@i2cat.net]
Envoyé : mercredi 16 avril 2014 10:26
À : user@aries.apache.org
Objet : ServiceUnavailableException

Hi all,
I have an OSGI application in which I use Aries Bluepint to publish my services. My scenario consists of two bundles: bundle A publishes serviceA and bundleB publish serviceB, in which serviceA is injected:
Bundle A / blueprint.xml

<bean id="serviceA" class="blabla.ServiceAImpl"/>
<service ref="serviceA" interface="blabla.ServiceA">
</service>
Bundle B / blueprint.xml

<reference id="serviceA" interface="blabla.ServiceA"/>

<bean id="serviceB" class="blabla.ServiceBImpl">
        <property name="serviceA" ref="serviceA" />
 </bean>
 <service ref="serviceB" interface="blabla.ServiceB">
 </service>

Sometimes, when deploying my application (and also when testing) I get the following error:

Caused by: org.osgi.service.blueprint.container.ServiceUnavailableException: The Blueprint container is being or has been destroyed: (objectClass=blabla.ServiceA)
    at org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:240)
    at org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:55)
    at org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:298)
    at Proxy1e317e77_0693_41e9_8bcb_60a2dbe3386c.getName(Unknown Source)
    at blabla.ServiceBImpl.getServiceA(ServiceBImpl.java:99)
    ... 47 more
Any idea on what could be happening?

Thanks!
Best regards,

--
[http://www.i2cat.net/sites/all/themes/elegantica/logo.png]
Adrián Roselló Rey
Distributed Applications and Networks Area (DANA)
i2CAT Foundation, Barcelona, Spain
T: +34 93 553 25 49
http://dana.i2cat.net