RE: Blueprint GracePeriod issue

2015-02-13 Thread CLEMENT Jean-Philippe
If you want to reference a service which is exported in the same bundle, you 
have to put the optional flag.

Having said that I'm not too sure what you wanted to do in the blueprint below. 
The reference-list is intended to call a bean (or beans) when the desired 
services match and disappear. In other words it behaves as a kind of service 
tracker.

Here is a basic example:







Where myBean would contain two public methods serviceFound and serviceLost. 
Also note that serviceLost method would be called with a null service if no 
service was found during startup, as per enterprise spec section 121.7.12.

JP

[@@ OPEN @@]

De : Leschke, Scott [mailto:slesc...@medline.com]
Envoyé : jeudi 12 février 2015 23:20
À : user@karaf.apache.org
Objet : RE: Blueprint GracePeriod issue

OK, if I understand you correctly, and I think I do since my test seems to bear 
that out, the bundle was going into GRACEPERIOD because there wasn't a service 
defined that implemented the exported service interface, hence the service 
injection can't work (which is what's happening, well sort of).  That explains 
why it used to work but began not working, since I simply wasn't deploying 
everything.

What confuses me a bit is that in this case, the lines in the blueprint.xml 
that seems to be causing the issue is the following:



   





It confuses me since the injection is of type List.  Since this 
list is "live" in the sense that entries can come and go at any time, shouldn't 
the injection of the list still succeed, but the list is empty, wouldn't that 
have made sense?  Perhaps there's a good reason why Blueprint isn't defined 
this way, I'd be curious as to what that reason is.

Thanks,

Scott

From: Benjamin Debeerst [mailto:benjamin.debee...@younicos.com]
Sent: Thursday, February 12, 2015 1:06 PM
To: user@karaf.apache.org<mailto:user@karaf.apache.org>
Subject: RE: Blueprint GracePeriod issue

Hi Scott,

I find that kind of diagnosis from Blueprint quite confusing as well, because 
Blueprint tends to mix up dependencies on the bundle layer and dependencies on 
the service layer.

The bundle is resolved and started, but the blueprint container/component is 
missing service dependencies, in particular it cannot find a service with the 
given interface in the OSGi service registry. This is why it cannot start the 
blueprint component/container and is in the grace period state.

Do you have some component exposing the interface in question as a service in 
the OSGi service registry?

Regards,
Benjamin

From: Leschke, Scott [mailto:slesc...@medline.com]
Sent: Donnerstag, 12. Februar 2015 19:14
To: user@karaf.apache.org<mailto:user@karaf.apache.org>
Subject: Blueprint GracePeriod issue

I have a bundle going into GracePeriod state.  The bundle:diag command says 
Missing Dependencies and gives me the name of an interface that exists in the 
bundle itself.  Is this indicative of a particular type of condition? I find it 
odd that it's complaining about not finding an interface that exists locally.


RE: Blueprint GracePeriod issue

2015-02-12 Thread Leschke, Scott
OK, if I understand you correctly, and I think I do since my test seems to bear 
that out, the bundle was going into GRACEPERIOD because there wasn't a service 
defined that implemented the exported service interface, hence the service 
injection can't work (which is what's happening, well sort of).  That explains 
why it used to work but began not working, since I simply wasn't deploying 
everything.

What confuses me a bit is that in this case, the lines in the blueprint.xml 
that seems to be causing the issue is the following:



   





It confuses me since the injection is of type List.  Since this 
list is "live" in the sense that entries can come and go at any time, shouldn't 
the injection of the list still succeed, but the list is empty, wouldn't that 
have made sense?  Perhaps there's a good reason why Blueprint isn't defined 
this way, I'd be curious as to what that reason is.

Thanks,

Scott

From: Benjamin Debeerst [mailto:benjamin.debee...@younicos.com]
Sent: Thursday, February 12, 2015 1:06 PM
To: user@karaf.apache.org
Subject: RE: Blueprint GracePeriod issue

Hi Scott,

I find that kind of diagnosis from Blueprint quite confusing as well, because 
Blueprint tends to mix up dependencies on the bundle layer and dependencies on 
the service layer.

The bundle is resolved and started, but the blueprint container/component is 
missing service dependencies, in particular it cannot find a service with the 
given interface in the OSGi service registry. This is why it cannot start the 
blueprint component/container and is in the grace period state.

Do you have some component exposing the interface in question as a service in 
the OSGi service registry?

Regards,
Benjamin

From: Leschke, Scott [mailto:slesc...@medline.com]
Sent: Donnerstag, 12. Februar 2015 19:14
To: user@karaf.apache.org<mailto:user@karaf.apache.org>
Subject: Blueprint GracePeriod issue

I have a bundle going into GracePeriod state.  The bundle:diag command says 
Missing Dependencies and gives me the name of an interface that exists in the 
bundle itself.  Is this indicative of a particular type of condition? I find it 
odd that it's complaining about not finding an interface that exists locally.


Re: Blueprint GracePeriod issue

2015-02-12 Thread David Bosschaert
I think the service dependency to a service published by the same
blueprint container will work if that dependency is marked optional.
Basically the problem is that Blueprint will not initialize its
component if the mandatory dependencies aren't available. If you make
that dependency optional you should get injected with the service
dependency from your own bundle...

On 12 February 2015 at 20:12, Achim Nierbeck  wrote:
> Hi,
>
> if you try to reference a service which you published through the same
> blueprint, this will fail.
> You should use the bean instead then.
>
> regards, Achim
>
>
> 2015-02-12 20:06 GMT+01:00 Benjamin Debeerst
> :
>>
>> Hi Scott,
>>
>>
>>
>> I find that kind of diagnosis from Blueprint quite confusing as well,
>> because Blueprint tends to mix up dependencies on the bundle layer and
>> dependencies on the service layer.
>>
>>
>>
>> The bundle is resolved and started, but the blueprint container/component
>> is missing service dependencies, in particular it cannot find a service with
>> the given interface in the OSGi service registry. This is why it cannot
>> start the blueprint component/container and is in the grace period state.
>>
>>
>>
>> Do you have some component exposing the interface in question as a service
>> in the OSGi service registry?
>>
>>
>>
>> Regards,
>>
>> Benjamin
>>
>>
>>
>> From: Leschke, Scott [mailto:slesc...@medline.com]
>> Sent: Donnerstag, 12. Februar 2015 19:14
>> To: user@karaf.apache.org
>> Subject: Blueprint GracePeriod issue
>>
>>
>>
>> I have a bundle going into GracePeriod state.  The bundle:diag command
>> says Missing Dependencies and gives me the name of an interface that exists
>> in the bundle itself.  Is this indicative of a particular type of condition?
>> I find it odd that it’s complaining about not finding an interface that
>> exists locally.
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>


Re: Blueprint GracePeriod issue

2015-02-12 Thread Achim Nierbeck
Hi,

if you try to reference a service which you published through the same
blueprint, this will fail.
You should use the bean instead then.

regards, Achim


2015-02-12 20:06 GMT+01:00 Benjamin Debeerst :

>  Hi Scott,
>
>
>
> I find that kind of diagnosis from Blueprint quite confusing as well,
> because Blueprint tends to mix up dependencies on the bundle layer and
> dependencies on the service layer.
>
>
>
> The bundle is resolved and started, but the blueprint container/component
> is missing *service dependencies, *in particular it cannot find a service
> with the given interface in the OSGi service registry. This is why it
> cannot start the blueprint component/container and is in the grace period
> state.
>
>
>
> Do you have some component exposing the interface in question as a service
> in the OSGi service registry?
>
>
>
> Regards,
>
> Benjamin
>
>
>
> *From:* Leschke, Scott [mailto:slesc...@medline.com]
> *Sent:* Donnerstag, 12. Februar 2015 19:14
> *To:* user@karaf.apache.org
> *Subject:* Blueprint GracePeriod issue
>
>
>
> I have a bundle going into GracePeriod state.  The bundle:diag command
> says *Missing Dependencies* and gives me the name of an interface that
> exists in the bundle itself.  Is this indicative of a particular type of
> condition? I find it odd that it’s complaining about not finding an
> interface that exists locally.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master


RE: Blueprint GracePeriod issue

2015-02-12 Thread Benjamin Debeerst
Hi Scott,

I find that kind of diagnosis from Blueprint quite confusing as well, because 
Blueprint tends to mix up dependencies on the bundle layer and dependencies on 
the service layer.

The bundle is resolved and started, but the blueprint container/component is 
missing service dependencies, in particular it cannot find a service with the 
given interface in the OSGi service registry. This is why it cannot start the 
blueprint component/container and is in the grace period state.

Do you have some component exposing the interface in question as a service in 
the OSGi service registry?

Regards,
Benjamin

From: Leschke, Scott [mailto:slesc...@medline.com]
Sent: Donnerstag, 12. Februar 2015 19:14
To: user@karaf.apache.org
Subject: Blueprint GracePeriod issue

I have a bundle going into GracePeriod state.  The bundle:diag command says 
Missing Dependencies and gives me the name of an interface that exists in the 
bundle itself.  Is this indicative of a particular type of condition? I find it 
odd that it's complaining about not finding an interface that exists locally.


Blueprint GracePeriod issue

2015-02-12 Thread Leschke, Scott
I have a bundle going into GracePeriod state.  The bundle:diag command says 
Missing Dependencies and gives me the name of an interface that exists in the 
bundle itself.  Is this indicative of a particular type of condition? I find it 
odd that it's complaining about not finding an interface that exists locally.