You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by mduduzik <md...@gmail.com> on 2016/09/09 20:04:35 UTC

Help debug ServiceDependency in DM4-R8

I have a DM component that depends on a service that looks like is available
(checking with WebConsole). However, the consuming DM component stays in
WAITING_FOR_REQUIRED state. How do I debug why an available service is not
being consumed. 

Note: required service is registered after the component is created (via
dm.add(component)).

Thanks.



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Help debug ServiceDependency in DM4-R8

Posted by mduduzik <md...@gmail.com>.
Ray,
That was the root cause. The publishing bundle was using an internal
(private) package and consuming bundle using one from cmpn. I'm sure this
saved me a few hours - at the least.

It'd be great if shell(gogo) command like 'dm wtf' can tell you component
from bundle X is waiting for a service whose package in exported by bundle
Y; and also show details published services of same name and corresponding
package imports. Maybe this qualifies for a feature request at DM repo.

Thanks again.
-Mdu  



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369p5018372.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Help debug ServiceDependency in DM4-R8

Posted by Pierre De Rop <pi...@gmail.com>.
Thanks Mdu, I will look into it.

cheers;
/pierre

On Mon, Sep 26, 2016 at 10:14 PM, mduduzik <md...@gmail.com> wrote:

> Pierre,
> I created  FELIX-5365 <https://issues.apache.org/jira/browse/FELIX-5365>
> issue.
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369p5018604.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Help debug ServiceDependency in DM4-R8

Posted by mduduzik <md...@gmail.com>.
Pierre,
I created  FELIX-5365 <https://issues.apache.org/jira/browse/FELIX-5365>  
issue.



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369p5018604.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Help debug ServiceDependency in DM4-R8

Posted by mduduzik <md...@gmail.com>.
Hi Pierre,
Sorry it took long to follow up. I'll create a feature request as advised.

Regards.
-Mdu



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369p5018502.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Help debug ServiceDependency in DM4-R8

Posted by Pierre De Rop <pi...@gmail.com>.
Hi Mdu,

Can you please open a change request issue in Jira for the "Dependency
Manager Shell" component ? We'll then investigate if  an improvement could
be done.

Also, can you please describe in jira the issue you had in order to avoid
going to the wrong direction ?

my understanding about the issue you had is:

- you have a bundle b1 with a component X depending on a service Y, which
package is imported from cmpn bundle.
- X is unregistered waiting for Y (version x.y.z)
- but Y is registered from bundle b2, which imports the Y package not from
cmpn but instead from a copy of Y service (version x.y.z) into the
b2 bundle (private).

and you would like "dm wtf" saying something like:

X unregistered from bundle b1, waiting for service Y version x.y.z with
package imported from cmpn;  but found an available Y service with same
version, provided by bundle b2 which imports the Y package from bundle b2.

Please confirm in the jira issue that this is the scenario you faced, and
we'll investigate if something can be done in order to improve the "dm wtf"
command (i don't know for now).

cheers
/Pierre

On Sat, Sep 10, 2016 at 12:18 AM, mduduzik <md...@gmail.com> wrote:

> Pierre,
> Like Ray, you are spot on. See my response post shortly before your
> recommendation.
>
> I think "dm wtf" can be improved to make my silly mistake obvious - or
> provide better hints.
>
> Thanks.
> -Mdu
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369p5018374.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Help debug ServiceDependency in DM4-R8

Posted by mduduzik <md...@gmail.com>.
Pierre,
Like Ray, you are spot on. See my response post shortly before your
recommendation.

I think "dm wtf" can be improved to make my silly mistake obvious - or
provide better hints.

Thanks.
-Mdu



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369p5018374.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Help debug ServiceDependency in DM4-R8

Posted by Pierre De Rop <pi...@gmail.com>.
By the way, the doc for the dm shell can be found here:

http://felix.apache.org/documentation/subprojects/apache-felix-dependency-manager/tutorials/leveraging-the-shell.html

cheers
/Pierre

On Sat, Sep 10, 2016 at 12:10 AM, Pierre De Rop <pi...@gmail.com>
wrote:

> Hi Mdu,
>
> indeed, it might be possible that the service consumer bundle is importing
> the package of the service it consumes from a bundle b1, while the service
> provider bundle is importing the package of the service from another bundle
> b2. in this case, the consumer won't see the service.
>
> can you please provide the following:
>
> 1) the package name of the service the consumer is depending on;
>
> 2) from web console, go to OSGi -> Bundles, then click on the service
> provider bundle, and indicate what is displayed for the "Imported Packages"
> section.
>
> 3) do the same for the service consumer bundle.
>
> then we'll see if both service provider bundle and service consumer bundle
> are importing the service package  from the same place.
>
> now, maybe it could also help to use the dm shell: if not installed, then
> install the dm shell bundle; and type "dm <id of the service provider
> bundle>", and provide what is displayed.
>
> then type "dm <id of the service consumer bundle>", and also provide what
> is displayed.
>
> the "dm na" displays all unavailable components, and the "dm wtf" display
> root causes which might block the activation of many components (for
> example, if A depends on B , and B depends on C, and C is unavailable, then
> "dm wtf" will only display "C").
>
> you could also, if possible, provide the Activator code for both service
> consumer and service provider.
> (send it to me by mail, in case you don't want to do that in this mailing
> list ... if possible).
>
> cheers;
> /Pierre
>

Re: Help debug ServiceDependency in DM4-R8

Posted by Pierre De Rop <pi...@gmail.com>.
Hi Mdu,

indeed, it might be possible that the service consumer bundle is importing
the package of the service it consumes from a bundle b1, while the service
provider bundle is importing the package of the service from another bundle
b2. in this case, the consumer won't see the service.

can you please provide the following:

1) the package name of the service the consumer is depending on;

2) from web console, go to OSGi -> Bundles, then click on the service
provider bundle, and indicate what is displayed for the "Imported Packages"
section.

3) do the same for the service consumer bundle.

then we'll see if both service provider bundle and service consumer bundle
are importing the service package  from the same place.

now, maybe it could also help to use the dm shell: if not installed, then
install the dm shell bundle; and type "dm <id of the service provider
bundle>", and provide what is displayed.

then type "dm <id of the service consumer bundle>", and also provide what
is displayed.

the "dm na" displays all unavailable components, and the "dm wtf" display
root causes which might block the activation of many components (for
example, if A depends on B , and B depends on C, and C is unavailable, then
"dm wtf" will only display "C").

you could also, if possible, provide the Activator code for both service
consumer and service provider.
(send it to me by mail, in case you don't want to do that in this mailing
list ... if possible).

cheers;
/Pierre

Re: Help debug ServiceDependency in DM4-R8

Posted by Raymond Auge <ra...@liferay.com>.
Note that service visibility is subject to class space coherence...

What does that mean?

It means that the package who's interface the service is published under,
has to be the same package imported by the referencing code. The service
registry won't offer up the service to the bundle who would suffer a
ClassCastException when handed the service instance otherwise.

So, what you want to do is check that both the service bundle and the
tracking bundle are using the same package.

HTH
- Ray

On Fri, Sep 9, 2016 at 1:04 PM, mduduzik <md...@gmail.com> wrote:

> I have a DM component that depends on a service that looks like is
> available
> (checking with WebConsole). However, the consuming DM component stays in
> WAITING_FOR_REQUIRED state. How do I debug why an available service is not
> being consumed.
>
> Note: required service is registered after the component is created (via
> dm.add(component)).
>
> Thanks.
>
>
>
> --
> View this message in context: http://apache-felix.18485.x6.
> nabble.com/Help-debug-ServiceDependency-in-DM4-R8-tp5018369.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)