You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Tomas Olsson <to...@sics.se> on 2011/09/02 19:17:16 UTC

DOSGI problem with service reference

Hi,
I am using felix together with CXF DOSGI using the example with iPOJO. 
However, I don't use annotation but I try to publishing as a declarative 
service. The problem is that if I add a service reference in the 
component declaration suddenly the service has no requirements or 
capabilities.

This setup works:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
immediate="true" name="org.me3gas.ceem.local">
<implementation class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
<service>
<provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
</service>

<property name="SOAP.service.name" type="String" 
value="EnergyEfficiencyManager"/>
<property name="service.exported.configs" type="String" 
value="org.apache.cxf.ws"/>
<property name="service.exported.interfaces" type="String" 
value="org.me3gas.ceem.EnergyEfficiencyManager"/>
<property name="org.apache.cxf.ws.httpservice.context" type="String" 
value="/me3gas/ceem/EnergyEfficiencyManager"/>

</scr:component>

But this does not:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
immediate="true" name="org.me3gas.ceem.local">
<implementation class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
<service>
<provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
</service>

<property name="SOAP.service.name" type="String" 
value="EnergyEfficiencyManager"/>
<property name="service.exported.configs" type="String" 
value="org.apache.cxf.ws"/>
<property name="service.exported.interfaces" type="String" 
value="org.me3gas.ceem.EnergyEfficiencyManager"/>
<property name="org.apache.cxf.ws.httpservice.context" type="String" 
value="/me3gas/ceem/EnergyEfficiencyManager"/>

<reference bind="setManager" cardinality="1..1" 
interface="org.me3gas.ceem.CollaborativeEnergyEfficiencyManager" 
name="CollaborativeEnergyEfficiencyManager" policy="dynamic" 
unbind="unsetManager"/>
</scr:component>


The bundle is active but when execute: "inspect service capability <ID>" 
in first case, I get the correct info, but in the second there is no 
info ("nothing" it says).

My bundles:

[   0] [Active     ] [    0] System Bundle (2.0.5)
[   1] [Active     ] [    1] Apache Commons Logging (1.1.1)
[   2] [Active     ] [    1] Distributed OSGi Distribution Software 
Single-Bundle Distribution (1.1)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.3)
[   4] [Active     ] [    1] Apache Felix Configuration Admin Service 
(1.2.6)
[   5] [Active     ] [    1] Apache Felix EventAdmin (1.2.2)
[   7] [Active     ] [    1] Apache Felix iPOJO Arch Command (1.6.0)
[   8] [Active     ] [    1] Apache Felix Declarative Services (1.6.0)
[   9] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
[  10] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
[  11] [Active     ] [    1] Apache Jakarta log4j Plug-in 
(1.2.15.v201005080500)
[  12] [Active     ] [    1] osgi.cmpn (4.2.0.200908310645)
[  16] [Active     ] [    1] EnergyEfficiencyFramworkAPI 
(1.0.0.201109021610)
[  18] [Active     ] [    1] Hydra Middleware API (1.0.0.201109021646)
[  19] [Active     ] [    1] HydraManagerConfigurator (1.0.0.201109021646)
[  26] [Active     ] [    1] EnergyEfficiencyManagerImpl 
(1.0.0.201109021830)
[  27] [Active     ] [    1] Apache Felix iPOJO (1.6.0)

/Tomas





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


Re: DOSGI problem with service reference

Posted by Tomas Olsson <to...@sics.se>.
No, I made a mistake, it still does not work.
/Tomas

On 9/5/11 1:25 PM, Tomas Olsson wrote:
> OK. I got it fixed. It was actually a problem with the 
> manifest/buil.properties file. Not very easy to detect. I had not 
> included the OSGI-INF/remote-service directory but only the 
> OSGI-INF/remote-service/remote-services.xml file. How that now is 
> possible...
>
> /Tomas
>
>
> On 9/3/11 12:12 PM, Tomas Olsson wrote:
>> OK, it does not seem to be a problem with the service reference. If I 
>> put the service provider and consumer in the same running OSGI 
>> instance it works fine (the consumer is assigned a provider). 
>> However, when I put them in two different running OSGI instances then 
>> the remote service is not detected. I use the following 
>> endpoint-description in OSGI-INF/remote-service/remote-services.xml 
>> (corresponding to the iPOJO DOSGI example, which works):
>>
>> <endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
>> <endpoint-description>
>> <property name="objectClass">
>> <array>
>> <value>org.me3gas.ceem.CollaborativeEnergyEfficiencyManager</value>
>> </array>
>> </property>
>> <property 
>> name="endpoint.id">http://localhost:8082/me3gas/ceem/CollaborativeEnergyEfficiencyManager</property>
>> <property name="service.imported.configs">org.apache.cxf.ws</property>
>> </endpoint-description>
>> </endpoint-descriptions>
>>
>> I have also tried this, in correspondence with the distributed iPOJO 
>> example:
>>
>> <endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
>> <endpoint-description>
>> <property name="objectClass">
>> <array>
>> <value>org.me3gas.ceem.CollaborativeEnergyEfficiencyManager</value>
>> </array>
>> </property>
>> <property 
>> name="endpoint.id">http://localhost:8082/me3gas/ceem/CollaborativeEnergyEfficiencyManager</property>
>> <property name="service.imported.configs">org.apache.cxf.ws</property>
>> </endpoint-description>
>> </endpoint-descriptions>
>>
>>
>> /Tomas
>>
>> On 9/2/11 7:17 PM, Tomas Olsson wrote:
>>> Hi,
>>> I am using felix together with CXF DOSGI using the example with 
>>> iPOJO. However, I don't use annotation but I try to publishing as a 
>>> declarative service. The problem is that if I add a service 
>>> reference in the component declaration suddenly the service has no 
>>> requirements or capabilities.
>>>
>>> This setup works:
>>>
>>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
>>> immediate="true" name="org.me3gas.ceem.local">
>>> <implementation 
>>> class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
>>> <service>
>>> <provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
>>> </service>
>>>
>>> <property name="SOAP.service.name" type="String" 
>>> value="EnergyEfficiencyManager"/>
>>> <property name="service.exported.configs" type="String" 
>>> value="org.apache.cxf.ws"/>
>>> <property name="service.exported.interfaces" type="String" 
>>> value="org.me3gas.ceem.EnergyEfficiencyManager"/>
>>> <property name="org.apache.cxf.ws.httpservice.context" type="String" 
>>> value="/me3gas/ceem/EnergyEfficiencyManager"/>
>>>
>>> </scr:component>
>>>
>>> But this does not:
>>>
>>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
>>> immediate="true" name="org.me3gas.ceem.local">
>>> <implementation 
>>> class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
>>> <service>
>>> <provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
>>> </service>
>>>
>>> <property name="SOAP.service.name" type="String" 
>>> value="EnergyEfficiencyManager"/>
>>> <property name="service.exported.configs" type="String" 
>>> value="org.apache.cxf.ws"/>
>>> <property name="service.exported.interfaces" type="String" 
>>> value="org.me3gas.ceem.EnergyEfficiencyManager"/>
>>> <property name="org.apache.cxf.ws.httpservice.context" type="String" 
>>> value="/me3gas/ceem/EnergyEfficiencyManager"/>
>>>
>>> <reference bind="setManager" cardinality="1..1" 
>>> interface="org.me3gas.ceem.CollaborativeEnergyEfficiencyManager" 
>>> name="CollaborativeEnergyEfficiencyManager" policy="dynamic" 
>>> unbind="unsetManager"/>
>>> </scr:component>
>>>
>>>
>>> The bundle is active but when execute: "inspect service capability 
>>> <ID>" in first case, I get the correct info, but in the second there 
>>> is no info ("nothing" it says).
>>>
>>> My bundles:
>>>
>>> [   0] [Active     ] [    0] System Bundle (2.0.5)
>>> [   1] [Active     ] [    1] Apache Commons Logging (1.1.1)
>>> [   2] [Active     ] [    1] Distributed OSGi Distribution Software 
>>> Single-Bundle Distribution (1.1)
>>> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.3)
>>> [   4] [Active     ] [    1] Apache Felix Configuration Admin 
>>> Service (1.2.6)
>>> [   5] [Active     ] [    1] Apache Felix EventAdmin (1.2.2)
>>> [   7] [Active     ] [    1] Apache Felix iPOJO Arch Command (1.6.0)
>>> [   8] [Active     ] [    1] Apache Felix Declarative Services (1.6.0)
>>> [   9] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
>>> [  10] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
>>> [  11] [Active     ] [    1] Apache Jakarta log4j Plug-in 
>>> (1.2.15.v201005080500)
>>> [  12] [Active     ] [    1] osgi.cmpn (4.2.0.200908310645)
>>> [  16] [Active     ] [    1] EnergyEfficiencyFramworkAPI 
>>> (1.0.0.201109021610)
>>> [  18] [Active     ] [    1] Hydra Middleware API (1.0.0.201109021646)
>>> [  19] [Active     ] [    1] HydraManagerConfigurator 
>>> (1.0.0.201109021646)
>>> [  26] [Active     ] [    1] EnergyEfficiencyManagerImpl 
>>> (1.0.0.201109021830)
>>> [  27] [Active     ] [    1] Apache Felix iPOJO (1.6.0)
>>>
>>> /Tomas
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


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


Re: DOSGI problem with service reference

Posted by Tomas Olsson <to...@sics.se>.
OK. I got it fixed. It was actually a problem with the 
manifest/buil.properties file. Not very easy to detect. I had not 
included the OSGI-INF/remote-service directory but only the 
OSGI-INF/remote-service/remote-services.xml file. How that now is 
possible...

/Tomas


On 9/3/11 12:12 PM, Tomas Olsson wrote:
> OK, it does not seem to be a problem with the service reference. If I 
> put the service provider and consumer in the same running OSGI 
> instance it works fine (the consumer is assigned a provider). However, 
> when I put them in two different running OSGI instances then the 
> remote service is not detected. I use the following 
> endpoint-description in OSGI-INF/remote-service/remote-services.xml 
> (corresponding to the iPOJO DOSGI example, which works):
>
> <endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
> <endpoint-description>
> <property name="objectClass">
> <array>
> <value>org.me3gas.ceem.CollaborativeEnergyEfficiencyManager</value>
> </array>
> </property>
> <property 
> name="endpoint.id">http://localhost:8082/me3gas/ceem/CollaborativeEnergyEfficiencyManager</property>
> <property name="service.imported.configs">org.apache.cxf.ws</property>
> </endpoint-description>
> </endpoint-descriptions>
>
> I have also tried this, in correspondence with the distributed iPOJO 
> example:
>
> <endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
> <endpoint-description>
> <property name="objectClass">
> <array>
> <value>org.me3gas.ceem.CollaborativeEnergyEfficiencyManager</value>
> </array>
> </property>
> <property 
> name="endpoint.id">http://localhost:8082/me3gas/ceem/CollaborativeEnergyEfficiencyManager</property>
> <property name="service.imported.configs">org.apache.cxf.ws</property>
> </endpoint-description>
> </endpoint-descriptions>
>
>
> /Tomas
>
> On 9/2/11 7:17 PM, Tomas Olsson wrote:
>> Hi,
>> I am using felix together with CXF DOSGI using the example with 
>> iPOJO. However, I don't use annotation but I try to publishing as a 
>> declarative service. The problem is that if I add a service reference 
>> in the component declaration suddenly the service has no requirements 
>> or capabilities.
>>
>> This setup works:
>>
>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
>> immediate="true" name="org.me3gas.ceem.local">
>> <implementation 
>> class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
>> <service>
>> <provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
>> </service>
>>
>> <property name="SOAP.service.name" type="String" 
>> value="EnergyEfficiencyManager"/>
>> <property name="service.exported.configs" type="String" 
>> value="org.apache.cxf.ws"/>
>> <property name="service.exported.interfaces" type="String" 
>> value="org.me3gas.ceem.EnergyEfficiencyManager"/>
>> <property name="org.apache.cxf.ws.httpservice.context" type="String" 
>> value="/me3gas/ceem/EnergyEfficiencyManager"/>
>>
>> </scr:component>
>>
>> But this does not:
>>
>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
>> immediate="true" name="org.me3gas.ceem.local">
>> <implementation 
>> class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
>> <service>
>> <provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
>> </service>
>>
>> <property name="SOAP.service.name" type="String" 
>> value="EnergyEfficiencyManager"/>
>> <property name="service.exported.configs" type="String" 
>> value="org.apache.cxf.ws"/>
>> <property name="service.exported.interfaces" type="String" 
>> value="org.me3gas.ceem.EnergyEfficiencyManager"/>
>> <property name="org.apache.cxf.ws.httpservice.context" type="String" 
>> value="/me3gas/ceem/EnergyEfficiencyManager"/>
>>
>> <reference bind="setManager" cardinality="1..1" 
>> interface="org.me3gas.ceem.CollaborativeEnergyEfficiencyManager" 
>> name="CollaborativeEnergyEfficiencyManager" policy="dynamic" 
>> unbind="unsetManager"/>
>> </scr:component>
>>
>>
>> The bundle is active but when execute: "inspect service capability 
>> <ID>" in first case, I get the correct info, but in the second there 
>> is no info ("nothing" it says).
>>
>> My bundles:
>>
>> [   0] [Active     ] [    0] System Bundle (2.0.5)
>> [   1] [Active     ] [    1] Apache Commons Logging (1.1.1)
>> [   2] [Active     ] [    1] Distributed OSGi Distribution Software 
>> Single-Bundle Distribution (1.1)
>> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.3)
>> [   4] [Active     ] [    1] Apache Felix Configuration Admin Service 
>> (1.2.6)
>> [   5] [Active     ] [    1] Apache Felix EventAdmin (1.2.2)
>> [   7] [Active     ] [    1] Apache Felix iPOJO Arch Command (1.6.0)
>> [   8] [Active     ] [    1] Apache Felix Declarative Services (1.6.0)
>> [   9] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
>> [  10] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
>> [  11] [Active     ] [    1] Apache Jakarta log4j Plug-in 
>> (1.2.15.v201005080500)
>> [  12] [Active     ] [    1] osgi.cmpn (4.2.0.200908310645)
>> [  16] [Active     ] [    1] EnergyEfficiencyFramworkAPI 
>> (1.0.0.201109021610)
>> [  18] [Active     ] [    1] Hydra Middleware API (1.0.0.201109021646)
>> [  19] [Active     ] [    1] HydraManagerConfigurator 
>> (1.0.0.201109021646)
>> [  26] [Active     ] [    1] EnergyEfficiencyManagerImpl 
>> (1.0.0.201109021830)
>> [  27] [Active     ] [    1] Apache Felix iPOJO (1.6.0)
>>
>> /Tomas
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


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


Re: DOSGI problem with service reference

Posted by Tomas Olsson <to...@sics.se>.
OK, it does not seem to be a problem with the service reference. If I 
put the service provider and consumer in the same running OSGI instance 
it works fine (the consumer is assigned a provider). However, when I put 
them in two different running OSGI instances then the remote service is 
not detected. I use the following endpoint-description in 
OSGI-INF/remote-service/remote-services.xml (corresponding to the iPOJO 
DOSGI example, which works):

<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
<endpoint-description>
<property name="objectClass">
<array>
<value>org.me3gas.ceem.CollaborativeEnergyEfficiencyManager</value>
</array>
</property>
<property 
name="endpoint.id">http://localhost:8082/me3gas/ceem/CollaborativeEnergyEfficiencyManager</property>
<property name="service.imported.configs">org.apache.cxf.ws</property>
</endpoint-description>
</endpoint-descriptions>

I have also tried this, in correspondence with the distributed iPOJO 
example:

<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
<endpoint-description>
<property name="objectClass">
<array>
<value>org.me3gas.ceem.CollaborativeEnergyEfficiencyManager</value>
</array>
</property>
<property 
name="endpoint.id">http://localhost:8082/me3gas/ceem/CollaborativeEnergyEfficiencyManager</property>
<property name="service.imported.configs">org.apache.cxf.ws</property>
</endpoint-description>
</endpoint-descriptions>


/Tomas

On 9/2/11 7:17 PM, Tomas Olsson wrote:
> Hi,
> I am using felix together with CXF DOSGI using the example with iPOJO. 
> However, I don't use annotation but I try to publishing as a 
> declarative service. The problem is that if I add a service reference 
> in the component declaration suddenly the service has no requirements 
> or capabilities.
>
> This setup works:
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
> immediate="true" name="org.me3gas.ceem.local">
> <implementation 
> class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
> <service>
> <provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
> </service>
>
> <property name="SOAP.service.name" type="String" 
> value="EnergyEfficiencyManager"/>
> <property name="service.exported.configs" type="String" 
> value="org.apache.cxf.ws"/>
> <property name="service.exported.interfaces" type="String" 
> value="org.me3gas.ceem.EnergyEfficiencyManager"/>
> <property name="org.apache.cxf.ws.httpservice.context" type="String" 
> value="/me3gas/ceem/EnergyEfficiencyManager"/>
>
> </scr:component>
>
> But this does not:
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" 
> immediate="true" name="org.me3gas.ceem.local">
> <implementation 
> class="org.me3gas.ceem.impl.EnergyEfficiencyManagerImpl"/>
> <service>
> <provide interface="org.me3gas.ceem.EnergyEfficiencyManager"/>
> </service>
>
> <property name="SOAP.service.name" type="String" 
> value="EnergyEfficiencyManager"/>
> <property name="service.exported.configs" type="String" 
> value="org.apache.cxf.ws"/>
> <property name="service.exported.interfaces" type="String" 
> value="org.me3gas.ceem.EnergyEfficiencyManager"/>
> <property name="org.apache.cxf.ws.httpservice.context" type="String" 
> value="/me3gas/ceem/EnergyEfficiencyManager"/>
>
> <reference bind="setManager" cardinality="1..1" 
> interface="org.me3gas.ceem.CollaborativeEnergyEfficiencyManager" 
> name="CollaborativeEnergyEfficiencyManager" policy="dynamic" 
> unbind="unsetManager"/>
> </scr:component>
>
>
> The bundle is active but when execute: "inspect service capability 
> <ID>" in first case, I get the correct info, but in the second there 
> is no info ("nothing" it says).
>
> My bundles:
>
> [   0] [Active     ] [    0] System Bundle (2.0.5)
> [   1] [Active     ] [    1] Apache Commons Logging (1.1.1)
> [   2] [Active     ] [    1] Distributed OSGi Distribution Software 
> Single-Bundle Distribution (1.1)
> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.3)
> [   4] [Active     ] [    1] Apache Felix Configuration Admin Service 
> (1.2.6)
> [   5] [Active     ] [    1] Apache Felix EventAdmin (1.2.2)
> [   7] [Active     ] [    1] Apache Felix iPOJO Arch Command (1.6.0)
> [   8] [Active     ] [    1] Apache Felix Declarative Services (1.6.0)
> [   9] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
> [  10] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
> [  11] [Active     ] [    1] Apache Jakarta log4j Plug-in 
> (1.2.15.v201005080500)
> [  12] [Active     ] [    1] osgi.cmpn (4.2.0.200908310645)
> [  16] [Active     ] [    1] EnergyEfficiencyFramworkAPI 
> (1.0.0.201109021610)
> [  18] [Active     ] [    1] Hydra Middleware API (1.0.0.201109021646)
> [  19] [Active     ] [    1] HydraManagerConfigurator 
> (1.0.0.201109021646)
> [  26] [Active     ] [    1] EnergyEfficiencyManagerImpl 
> (1.0.0.201109021830)
> [  27] [Active     ] [    1] Apache Felix iPOJO (1.6.0)
>
> /Tomas
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


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