Sorry for the delay, that pesky job thing got in the way :-)

I'm using java 7 too…. I wonder if this would fix the compilation problem? 
(ConfigurableComponentHolder.java line 671)

            m_enablePromise = new 
Deferred<List<Void>>().resolveWith(Promises.<Void, Void>all(promises));

There is a unit test for targeted PIDS, 
org.apache.felix.scr.integration.TargetedPIDTest which I think does cover the 
scenario you are trying to use.

What ConfigAdmin implementation are you using?  This may not work if it doesn't 
support the R5 config admin spec.  

I would turn on DS logging in your environment (you probably need to set 
ds.loglevel=debug in your framework properties and make sure you have an OSGI 
log service running) and look for the messages that a configuration has arrived 
from config admin for your bundle and see what the pid is and try to figure out 
what happens.  If you get a log with these messages and can't interpret them 
send it to me off-list and I will have a look.

thanks!
david jencks



On Aug 26, 2014, at 6:18 AM, Hawk Osgi <[email protected]> wrote:

> David,
> The duplication error gone but couldn't make the targetPID configuration work 
> with 1.8.2, even with only one bundle version installed.When trying with this 
> 'getConfigAdminService().getConfiguration("an.factory.pid")' then my 
> component instance is activated. But when using these targetPID strings 
> "an.factory.pid|an.Bundle|" or "an.factory.pid|an.Bundle|1.0.0" my component 
> instance is not activated. It is the right sintax, right?
> 
> 
> I would like to try with trunk's version, but I'm getting compilation errors:
> [ERROR] 
> /home/jhawk/felix/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurableComponentHolder.java:[671,56]
>  error: method resolveWith in class Deferred<T> cannot be applied to given 
> types;
> should I use any special parameter/profile to build it using java 7 compiler ?
> 
> thanks and regards,
> John
> 
> 
> 
> 
> Em Quarta-feira, 20 de Agosto de 2014 17:45, David Jencks 
> <[email protected]> escreveu:
> 
> 
> 
> The two components do look pretty similar…. to configure them separately you 
> have to use the rather recent feature of targetedPIDS.  I suggest reading 
> about them in the R5 enterprise spec config admin chapter.  There is support 
> for them in Felix DS 1.8.2 although spec support is upcoming in R6 enterprise 
> spec.  They are not well tested in practice.
> 
> You tell config admin a targetedPID when you set up the configuration.  It's 
> going to have the form 
> <pid>|<bundle-symbolic-name>|<bundle-version>|<location> where you only use 
> as many bits (left to right) as you need.
> 
> So I think for your case you would have
> 
> 
> myPid|myBundleName|1.0.0
> myPid|myBundleName|2.0.0
> 
> If this doesn't actually work with 1.8.2 please let us know and also try 
> trunk.
> 
> 
> BTW I don't know what Luna might include but there is a separate eclipse SCR 
> implementation unrelated to the felix one.  I don't think anyone has tried to 
> update it to any post R5 features.  I thought it supported R5/ scr 1.2 so I'm 
> a little surprised you got an error: you wouldn't be able to configure the 
> components separately however.  Maybe the error comes from config admin???
> 
> thanks
> david jencks
> 
> 
> On Aug 20, 2014, at 11:28 AM, Hawk Osgi <[email protected]> wrote:
> 
>> confirmed. error gone with Felix 4.4.1 and SCR 1.8.2. great !
>> 
>> 
>> but I still couldn't figure out how to configure a service instance 
>> differently for each version. for now, both services are being activated by 
>> the same configuration. investigating...
>> 
>> 
>> regards
>> 
>> 
>> 
>> Em Quarta-feira, 20 de Agosto de 2014 10:22, Hawk Osgi 
>> <[email protected]> escreveu:
>> 
>> 
>> 
>> Hi,
>> thanks for the time...
>> I tried with felix 4.4.0 and scr 1.8.0... will try with felix 4.4.1 and scr 
>> 1.8.2.  
>> 
>> Btw, I also tried with equinox Luna and had the same kind of error ( I 
>> thought that equinox was using the same Scr than felix).
>> 
>> Could you explain me what is the expected behaviour ? How could I 
>> differentiate the 2 components PID or FPID, so I can configure them using 
>> ConfigAdmin with different properties? 
>> 
>> regards,
>> 
>> John
>> 
>> 
>> 
>> 
>> Em Quarta-feira, 20 de Agosto de 2014 1:33, David Jencks 
>> <[email protected]> escreveu:
>> 
>> 
>> 
>> What version of felix ds are you using?  This was not supported in early 
>> versions  of the spec but has been for a while.  Certainly the latest 
>> release (1.8.2) supports this.  Of course there might be a bug….
>> 
>> thanks
>> david jencks
>> 
>> 
>> On Aug 19, 2014, at 7:07 PM, Hawk Osgi <[email protected]> wrote:
>> 
>>> Hi,
>>> 
>>> I'm learning OSGi, I know that I can install different versions of same 
>>> bundle but can't find anything in spec about component version.
>>> 
>>> I installed two versions 1.0.0 and 2.0.0 of a same bundle that contains one 
>>> DS component. 
>>> 
>>> But when I tried to activate them I got a message complaining about the 
>>> duplicated names.
>>> 
>>> 
>>> there are a way tohave two versions of same component activated?
>>> 
>>> thanks
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

Reply via email to