Re: How to investigate a "Unsatisfied" reference with felix.scr ?

2018-07-12 Thread Neil Bartlett
On Thu, Jul 12, 2018 at 2:01 AM, Cristiano  wrote:

> Hi Neil,
>
> yes, it was the output from felix scr:list command.
>
> Take a look at the bundles loaded in PDE below.
>
> idState   Bundle
>> 0ACTIVE  org.eclipse.osgi_3.13.0.v20180409-1500
>> Fragments=18
>> 1STARTINGbr.com.c8tech.osgi.lib.cm_0.1.1.SNAPSHOT
>> 2STARTINGbr.com.c8tech.osgi.lib_0.1.1.SNAPSHOT
>> 3ACTIVE  ch.qos.logback.classic_1.2.3
>> 4ACTIVE  ch.qos.logback.core_1.2.3
>> 5ACTIVE  org.apache.felix.gogo.command_1.0.2
>> 6ACTIVE  org.apache.felix.gogo.runtime_1.1.0
>> 7ACTIVE  org.apache.felix.gogo.shell_1.1.0
>> 8ACTIVE  org.apache.felix.logback_1.0.0
>> *9ACTIVE  org.apache.felix.scr_2.1.0*
>> 10ACTIVE  org.eclipse.equinox.cm_1.3.0.v20180418-1839
>> 11ACTIVE org.eclipse.equinox.common_3.10.0.v20180412-1130
>> 12ACTIVE org.eclipse.equinox.console_1.3.0.v20180119-0630
>> 13RESOLVED org.eclipse.equinox.coordinator_1.3.500.v20171221-2204
>> 14ACTIVE  org.eclipse.equinox.ds_1.5.100.v20171221-2204
>> 15ACTIVE org.eclipse.equinox.event_1.4.200.v20180426-0845
>> 16RESOLVED org.eclipse.equinox.metatype_1.4.400.v20180501-1616
>> 17ACTIVE org.eclipse.equinox.preferences_3.7.100.v20180510-1129
>> 18RESOLVED org.eclipse.equinox.region_1.4.100.v20171221-2204
>> Master=0
>> 19ACTIVE  org.eclipse.equinox.util_1.1.0.v20180419-0833
>> 20RESOLVEDorg.eclipse.osgi.services_3.7.0.v20180223-1712
>> 21RESOLVEDorg.eclipse.osgi.util_3.5.0.v20180219-1511
>> 22RESOLVEDslf4j.api_1.7.25
>>
>

I notice that you are using both org.eclipse.equinox.ds AND
org.apache.felix.scr. You really shouldn't use multiple SCR implementations
in the same OSGi Framework, they are likely to conflict and/or create
duplicates of every component.



>
> and if you repair a bit in my latest email, you will see that I've passed
> the component name to the scr:info command.
>

This is probably the problem. If you pass in the ID of a component
configuration (which will be a number) then you will see the full
inspection information for that configuration. If you only pass a component
name then you will see higher level information.


>
>
> Well, after a lng day playing with this issue I finally found the
> reason of such weird problem: *can't use **org.apache.felix.scr_2.1.0 with
> **equinox photon *!!!
>

I do not think this is true.


>
> even though *org.eclipse.equinox.ds* is allowing it on its manifest:
>

Again, you don't need two SCR implementations! You should just remove
org.eclipse.equinox.ds.


>
> Require-Bundle: org.apache.felix.scr;bundle-ve
>> rsion="[2.0.0,3.0.0)";visibility:=reexport
>>
>
> and also org.apache.felix.scr is being activated without any error:
>
> 20:55:20||INFO|ServiceEvent REGISTERED {org.apache.felix.scr.ScrService}={
>> service.id=48, service.bundleid=14, service.scope=singleton}|E.S.o
>> .eclipse.equinox.ds||E.S.o.e.e.ds@?[Start Level: Equinox Container:
>> efcce77e-ec67-408f-a0a2-1a83d6547c3c]
>>
>
>
> I was not able to discover the real reason for that incompatibility. maybe
> is something related to equinox.ds reexporting felix.scr packages or
> because it is tied to DS 1.3.
>
>
> But the fact is that after I have replaced the org.apache.felix.scr by
> version 2.0.14  I was able to debug and identify my issue. :-)
>
> I've simulated one problem (removed EventAdmin bundle) just to show how
> different the output of the command scr:info is now:
>
> g! scr:info c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationEx
>> tendedService
>> *** Bundle: br.com.c8tech.osgi.lib.cm (1)
>> Component Description:
>>   Name: c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationEx
>> tendedService
>>   Implementation Class: c8tech.osgi.lib.cm.internal.Co
>> mponentProviderConfigurationExtendedService
>>   Default State: enabled
>>   Activation: immediate
>>   Configuration Policy: optional
>>   Activate Method: activate
>>   Deactivate Method: deactivate
>>   Modified Method: -
>>   Configuration Pid: [c8tech.osgi.lib.cm.internal.C
>> omponentProviderConfigurationExtendedService]
>>   Services:
>> c8tech.osgi.lib.api.cm.ConfigurationAdminExtendedService
>>   Service Scope: singleton
>>   Reference: ConfigurationAdmin
>> Interface Name: org.osgi.service.cm.ConfigurationAdmin
>> Cardinality: 1..1
>> Policy: static
>> Policy option: reluctant
>> Reference Scope: bundle
>>   Reference: EventAdminService
>> Interface Name: org.osgi.service.event.EventAdmin
>> Cardinality: 1..1
>> Policy: static
>> Policy option: reluctant
>> Reference Scope: bundle
>>   Reference: PreferencesService
>> Interface Name: org.osgi.service.prefs.PreferencesService
>> Cardinality: 1..1
>> Policy: static
>> Policy option: reluctant
>> Reference Scope: bundle
>>   Component Description Properties:
>>   Component Configuration:
>>   

Re: How to investigate a "Unsatisfied" reference with felix.scr ?

2018-07-11 Thread Cristiano

Hi Neil,

yes, it was the output from felix scr:list command.

Take a look at the bundles loaded in PDE below.


id    State   Bundle
0    ACTIVE  org.eclipse.osgi_3.13.0.v20180409-1500
    Fragments=18
1    STARTING    br.com.c8tech.osgi.lib.cm_0.1.1.SNAPSHOT
2    STARTING    br.com.c8tech.osgi.lib_0.1.1.SNAPSHOT
3    ACTIVE  ch.qos.logback.classic_1.2.3
4    ACTIVE  ch.qos.logback.core_1.2.3
5    ACTIVE  org.apache.felix.gogo.command_1.0.2
6    ACTIVE  org.apache.felix.gogo.runtime_1.1.0
7    ACTIVE  org.apache.felix.gogo.shell_1.1.0
8    ACTIVE  org.apache.felix.logback_1.0.0
*9    ACTIVE  org.apache.felix.scr_2.1.0*
10    ACTIVE  org.eclipse.equinox.cm_1.3.0.v20180418-1839
11    ACTIVE org.eclipse.equinox.common_3.10.0.v20180412-1130
12    ACTIVE org.eclipse.equinox.console_1.3.0.v20180119-0630
13    RESOLVED org.eclipse.equinox.coordinator_1.3.500.v20171221-2204
14    ACTIVE  org.eclipse.equinox.ds_1.5.100.v20171221-2204
15    ACTIVE org.eclipse.equinox.event_1.4.200.v20180426-0845
16    RESOLVED org.eclipse.equinox.metatype_1.4.400.v20180501-1616
17    ACTIVE org.eclipse.equinox.preferences_3.7.100.v20180510-1129
18    RESOLVED org.eclipse.equinox.region_1.4.100.v20171221-2204
    Master=0
19    ACTIVE  org.eclipse.equinox.util_1.1.0.v20180419-0833
20    RESOLVED    org.eclipse.osgi.services_3.7.0.v20180223-1712
21    RESOLVED    org.eclipse.osgi.util_3.5.0.v20180219-1511
22    RESOLVED    slf4j.api_1.7.25


and if you repair a bit in my latest email, you will see that I've 
passed the component name to the scr:info command.



Well, after a lng day playing with this issue I finally found the 
reason of such weird problem: *can't use **org.apache.felix.scr_2.1.0 
with **equinox photon *!!!


even though *org.eclipse.equinox.ds* is allowing it on its manifest:

Require-Bundle: 
org.apache.felix.scr;bundle-version="[2.0.0,3.0.0)";visibility:=reexport


and also org.apache.felix.scr is being activated without any error:

20:55:20||INFO|ServiceEvent REGISTERED 
{org.apache.felix.scr.ScrService}={service.id=48, service.bundleid=14, 
service.scope=singleton}|E.S.o.eclipse.equinox.ds||E.S.o.e.e.ds@?[Start 
Level: Equinox Container: efcce77e-ec67-408f-a0a2-1a83d6547c3c]



I was not able to discover the real reason for that incompatibility. 
maybe is something related to equinox.ds reexporting felix.scr packages 
or because it is tied to DS 1.3.



But the fact is that after I have replaced the org.apache.felix.scr by 
version 2.0.14  I was able to debug and identify my issue. :-)


I've simulated one problem (removed EventAdmin bundle) just to show how 
different the output of the command scr:info is now:


g! scr:info 
c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationExtendedService

*** Bundle: br.com.c8tech.osgi.lib.cm (1)
Component Description:
  Name: 
c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationExtendedService
  Implementation Class: 
c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationExtendedService

  Default State: enabled
  Activation: immediate
  Configuration Policy: optional
  Activate Method: activate
  Deactivate Method: deactivate
  Modified Method: -
  Configuration Pid: 
[c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationExtendedService]

  Services:
    c8tech.osgi.lib.api.cm.ConfigurationAdminExtendedService
  Service Scope: singleton
  Reference: ConfigurationAdmin
    Interface Name: org.osgi.service.cm.ConfigurationAdmin
    Cardinality: 1..1
    Policy: static
    Policy option: reluctant
    Reference Scope: bundle
  Reference: EventAdminService
    Interface Name: org.osgi.service.event.EventAdmin
    Cardinality: 1..1
    Policy: static
    Policy option: reluctant
    Reference Scope: bundle
  Reference: PreferencesService
    Interface Name: org.osgi.service.prefs.PreferencesService
    Cardinality: 1..1
    Policy: static
    Policy option: reluctant
    Reference Scope: bundle
  Component Description Properties:
  Component Configuration:
    ComponentId: 0
    State: unsatisfied reference
    SatisfiedReference: ConfigurationAdmin
  Target: null
  (unbound)
    SatisfiedReference: PreferencesService
  Target: null
  (unbound)
    UnsatisfiedReference: EventAdminService
  Target: null
  (no target services)
    Component Configuration Properties:
    component.id = 0
    component.name = 
c8tech.osgi.lib.cm.internal.ComponentProviderConfigurationExtendedService


thanks to all,

Cristiano


On 11/07/2018 15:21, Neil Bartlett wrote:

Indeed this cannot be the scr:info command from Felix SCR, because the
Felix command requires an argument (the component ID) and would have failed
when called without one.

Perhaps a bundle listing would help us identify what you are working with.

Neil






Re: How to investigate a "Unsatisfied" reference with felix.scr ?

2018-07-11 Thread Neil Bartlett
Indeed this cannot be the scr:info command from Felix SCR, because the
Felix command requires an argument (the component ID) and would have failed
when called without one.

Perhaps a bundle listing would help us identify what you are working with.

Neil


On Wed, 11 Jul 2018 at 18:28, David Jencks  wrote:

> Hi Cristiano,
>
> That doesn’t look much like what I recall my version of scr:info produced,
> I’d expect better indenting and a ComponentConfiguration section following,
> and the ComponentConfiguration ought to list the references defined in the
> component xml.  Are you sure that you are actually using felix ds and that
> the scr:info command you use actually comes from felix? What is in the
> “equinox compendium” you mention?
>
> Did anyone significantly change how scr:info works?
>
> thanks
> david jencks
>
> > On Jul 11, 2018, at 9:51 AM, Cristiano  wrote:
> >
> > Hi David,  thanks for the time...
> >
> > Unfortunately, there are no enough information provided by scr:info in
> order to help identify what is happen with this immediate component.
> >
> > Below is what I'm seeing:
> >
> >> g! scr:info
> c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
> >> Component Description:
> c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
> >>
> 
> >> Class:
> c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
> >> Bundle:1 (br.com.c8tech.osgi.lib.cm:0.1.1.SNAPSHOT)
> >> Enabled:   true
> >> Immediate: true
> >> Services: [c8tech.osgi.lib.api.cm.ConfigurationAdminExtendedService]
> >> Scope: singleton
> >> Config PID(s):
> [c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider],
> Policy: optional
> >> Base Props:(0 entries)
> >
> > best regards,
> >
> > Cristiano
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> > For additional commands, e-mail: users-h...@felix.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


Re: How to investigate a "Unsatisfied" reference with felix.scr ?

2018-07-11 Thread David Jencks
Hi Cristiano,

That doesn’t look much like what I recall my version of scr:info produced, I’d 
expect better indenting and a ComponentConfiguration section following, and the 
ComponentConfiguration ought to list the references defined in the component 
xml.  Are you sure that you are actually using felix ds and that the scr:info 
command you use actually comes from felix? What is in the “equinox compendium” 
you mention?

Did anyone significantly change how scr:info works?

thanks
david jencks

> On Jul 11, 2018, at 9:51 AM, Cristiano  wrote:
> 
> Hi David,  thanks for the time...
> 
> Unfortunately, there are no enough information provided by scr:info in order 
> to help identify what is happen with this immediate component.
> 
> Below is what I'm seeing:
> 
>> g! scr:info 
>> c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
>> Component Description: 
>> c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
>> 
>> Class: 
>> c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
>> Bundle:1 (br.com.c8tech.osgi.lib.cm:0.1.1.SNAPSHOT)
>> Enabled:   true
>> Immediate: true
>> Services: [c8tech.osgi.lib.api.cm.ConfigurationAdminExtendedService]
>> Scope: singleton
>> Config PID(s): 
>> [c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider], 
>> Policy: optional
>> Base Props:(0 entries)
> 
> best regards,
> 
> Cristiano
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
> 


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



Re: How to investigate a "Unsatisfied" reference with felix.scr ?

2018-07-11 Thread Cristiano

Hi David,  thanks for the time...

Unfortunately, there are no enough information provided by scr:info in 
order to help identify what is happen with this immediate component.


Below is what I'm seeing:

g! scr:info 
c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider
Component Description: 
c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider


Class: 
c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider

Bundle:    1 (br.com.c8tech.osgi.lib.cm:0.1.1.SNAPSHOT)
Enabled:   true
Immediate: true
Services: [c8tech.osgi.lib.api.cm.ConfigurationAdminExtendedService]
Scope: singleton
Config PID(s): 
[c8tech.osgi.lib.cm.internal.ComponentConfigurationExtendedServiceProvider], 
Policy: optional

Base Props:    (0 entries)


best regards,

Cristiano

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



Re: How to investigate a "Unsatisfied" reference with felix.scr ?

2018-07-09 Thread David Jencks
Hmm, when I last worked on it, admittedly a couple of years ago, I recall 
scr:info did indicate everything possible about the components including 
unsatisfied references. What are you seeing from scr:info?  At one time karaf 
replaced the felix-supplied scr command with something that basically didn’t 
work, but I think that was long ago.  I certainly used the info provided from 
the scr command (although in IBM Liberty it shows up elsewhere more easily) to 
figure out missing references.

david jencks


> On Jul 9, 2018, at 4:29 PM, Cristiano  wrote:
> 
> Hi all,
> 
> Couple years ago I used to use a command (from equinox.ds that uses felix.scr 
> from behind) called "comp" that help me a lot to investigate when a component 
> was not activated:
>> |osgi> comp 6 Component[ name = com.mycompany.foo.Service ... state = 
>> Unsatisfied references = { ... Reference[name = HttpService, interface = 
>> org.osgi.service.http.HttpService, policy = static, cardinality = 1..1, 
>> target = null, bind = setHttpService, unbind = unsetHttpService] } located 
>> in bundle = com.mycompany.foo_1.2.3 [18] ] Dynamic information : *The 
>> component is NOT satisfied The following references are not satisfied: 
>> Reference[name = HttpService, interface = org.osgi.service.http.HttpService, 
>> policy = static, cardinality = 1..1, target = null, bind = setHttpService, 
>> unbind = unsetHttpService] Component configurations : Configuration 
>> properties: component.name = com.mycompany.foo.Service component.id = 6 
>> Instances: |
> 
> |Returning to the OSGi world and using the current versions of felix and 
> equinox compendium bundles I cannot find such command anymore. I tried 
> scr:info but it doesn't show me component's reference information.
> 
> So, how do you guys do to investigate an "Unsatisfied" reference with felix ?
> 
> thanks for any tip,
> 
> best regards,
> 
> Cristiano
> |


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