felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gay David (Annecy)" <d...@axway.com>
Subject RE: iPojo Composite
Date Fri, 27 Jan 2012 18:18:54 GMT
Hi Clement,

Thanks for your help.
I've open a Jira for the composite problem here : https://issues.apache.org/jira/browse/FELIX-3323
Tell me if you also want me to open a Jira for the @Updated problem or if you need more time
to investigate.


Have a nice week end.
WBR // David G.


-----Original Message-----
From: Clement Escoffier [mailto:clement.escoffier@gmail.com] 
Sent: mercredi 25 janvier 2012 10:20
To: users@felix.apache.org
Subject: Re: iPojo Composite

Hi,


On 23.01.2012, at 16:50, Gay David (Annecy) wrote:

> Hi,
>  
> I have some problems with the iPojo composite.
> I made a simple project to illustrate what's happen. See in attachment.
> There are 2 bundles : one that define a service, one other that define a composite.
>  
> Just compile and install theses 2 bundles in a Felix runtime.
> You should have this bundles :
>  
> g! lb
> START LEVEL 1
>    ID|State      |Level|Name
>     0|Active     |    0|System Bundle (4.0.2)
>     1|Active     |    1|Apache Felix Bundle Repository (1.6.6)
>     2|Active     |    1|Apache Felix Configuration Admin Service (1.2.8)
>     3|Active     |    1|Apache Felix EventAdmin (1.2.14)
>     4|Active     |    1|Apache Felix File Install (3.1.10)
>     5|Active     |    1|Apache Felix Gogo Command (0.12.0)
>     6|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
>     7|Active     |    1|Apache Felix Gogo Shell (0.10.0)
>     8|Active     |    1|Apache Felix iPOJO (1.8.0)
>     9|Active     |    1|Apache Felix iPOJO API (1.6.0)
>    10|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
>    11|Active     |    1|Apache Felix iPOJO Composite (1.8.0)
>    12|Active     |    1|Apache Felix Metatype Service (1.0.4)
>    13|Active     |    1|foo-provider (1.0.0.SNAPSHOT)
>    14|Active     |    1|foo-composite (1.0.0.SNAPSHOT)
>  
> I use the file install to create the services instances.
>  
> 1- @Updated not call
>  
> Don't know if there is a problem in my code but if I create an instance, thanks to FileInstall
in
> <FELIX_RUN>/load/foo.provider.impl.FooServiceImpl-0.cfg with this content : job.name=ADummyValue
>  
> The service is well create: no problem.
> The configuration is well inject : no problem
>  
> For example :
> g! instance foo.provider.impl.FooServiceImpl.bc404b98-4118-418e-84cb-deba273eb309
> instance name="foo.provider.impl.FooServiceImpl.bc404b98-4118-418e-84cb-deba273eb309"
component.type="foo.provider.impl.FooServiceImpl" state="valid" bundle="13"
>         handler name="org.apache.felix.ipojo:properties" state="valid"
>                 property name="job.name" value="ADummyValue"
>         handler name="org.apache.felix.ipojo:provides" state="valid"
>                 provides service.id="40" state="registered" specifications="[foo.provider.FooService]"
>                         property name="service.pid" value="foo.provider.impl.FooServiceImpl.bc404b98-4118-418e-84cb-deba273eb309"
>                         property name="factory.name" value="foo.provider.impl.FooServiceImpl"
>                         property name="instance.name" value="foo.provider.impl.FooServiceImpl.bc404b98-4118-418e-84cb-deba273eb309"
>         handler name="org.apache.felix.ipojo:architecture" state="valid"
>  
> If I change the content of the .cfg with job.name= ADummyValue2 : is working also.
>  
> But, the lifecycle callback @Updated is never called !

That seems to be a bug. I will have a look. We recently 'enhanced' the condition to call @Updated.
Maybe we're a bit too strict :-)


>  
>  
> 2- Composite
>  
> I try the same with the composite.
> Create a file <FELIX_RUN>/load/foo.compo-0.cfg with content job.name=DummyCompo
>  
> It's working very well, I even see my System.out : "Configuration updated :DummyCompo",
great !
>  
> But, if I update the job.name with job.name=DummyCompo2 .... I have an exception :
>  
> *ERROR* [org.apache.felix.ipojo.Factory, org.osgi.service.cm.ManagedServiceFactory, id=38,
bundle=14]: Unexpected problem updating Configuration PID=foo.compo.26ec176f-6860-4100-a538-b5fb523d4a1f,
fac
> toryPID=foo.compo, bundleLocation=file:../foo-composite/target/foo-composite-1.0.0-SNAPSHOT.jar
> java.lang.ClassCastException: org.apache.felix.ipojo.composite.CompositeManager cannot
be cast to org.apache.felix.ipojo.InstanceManager
>         at org.apache.felix.ipojo.IPojoFactory.updated(IPojoFactory.java:627)
>         at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1567)
>         at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)
>         at java.lang.Thread.run(Unknown Source)
>  
> Also, did I do something wrong ?
>  

This is definitely a bug. Could you open a jira issue ?

Regards,

Clement

>  
>  
> Thanks all for your help.
> WBR // David G.
>  
>  
> <composite.zip>
> ---------------------------------------------------------------------
> 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


Mime
View raw message