felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: SCR 1.6.2 behaviour change - services bound in an activate method are no longer bound back to the same component instance
Date Tue, 28 May 2013 21:26:23 GMT
Hi Snorre,

I don't understand what you are asking very well.  What are you trying to do with a null object
and what does this have to do with DS?  What code stops running?  How do you know it's stopped
rather than never started?

What do you mean by a service that is registered without an implementation?  You've registered
a ServiceFactory?  What is the setService function?

I think you posted a link to a github repo but I haven't had time to clone it and investigate.
 Could you provide more details in your emails without duplicating the project?  For instance
show how many bundles you have set up, which DS components are in which bundles, how you want
to use the DS services, and something about the DS components.

One possibility that might explain what I think you are describing below-- it's hard to tell
-- is that your DS component registers a service but is not marked immediate.  Then the service
will be registered right away but the implementation object will only be created when the
service is requested from the service reference.

thanks
david jencks

On May 28, 2013, at 1:39 PM, Snorre Lothar von Gohren Edwin <snorre.edwin@gmail.com>
wrote:

> I would like to add a question to this thread. For some reason when im
> using DS and im trying to do something with a null object. I dont get any
> respons at all. The code just stops running, and runs everything else.
> Also, if I have a service that is registered, but without an
> implementation, the setService function just wont run and it does not
> provide any feedback. Is it suppose to be like this, it does waste a lot of
> time for new developers to debug this stuff.
> 
> For example:
> 
> @Activate
> public void activate(ComponentContext ctx) {
> System.out.println(context.getBundle().getSymbolicName());
> this.context = ctx.getBundleContext();
> System.out.println("YOlllo!");
> run();
> }
> 
> 
> This context is null, yes I know its wrong but this is just a display
> method for you guys to see. Running this provides nothing at all. The
> bundle dont do anything but still has state as active.
> Shouldnt this provide some sort of warning?
> 
> Maybe there is something I have not gotten to in the DS spesifications but
> just a headsup for use newbies that is trying to learn OSGi and might one
> day convince other to use it.
> 
> 
> 
> 
> On Tue, May 28, 2013 at 10:14 PM, David Jencks <david_jencks@yahoo.com>wrote:
> 
>> I'm currently not aware of any problems I want to fix in DS although I'd
>> like to write some tests for the new location binding and targeted PID
>> functionality… so I might be interested in a release soon.  There have been
>> a lot of changes so I'd rather appreciate it if you could try out the
>> current code.
>> 
>> My last attempt to upload a DS snapshot didn't work, can anyone else have
>> a try?
>> 
>> thanks
>> david jencks
>> 
>> On May 28, 2013, at 8:01 AM, Robert Munteanu <robert@lmn.ro> wrote:
>> 
>>> On Tue, May 28, 2013 at 5:55 PM, Felix Meschberger <fmeschbe@adobe.com>
>> wrote:
>>>> HI Robert
>>>> 
>>>> As I noted in your issue (SLING-2876) this is fixed post-1.6.2 as per
>> FELIX-3754. It has been a timing issue handling the activator and the bind
>> methods.
>>>> 
>>>> Hope this helps.
>>> 
>>> Hi Felix,
>>> 
>>> Thanks for the pointer, I saw the issue comment after I posted this
>>> mail. I'll just revert to a SCR 1.6.0 until 1.8.0 is out.
>>> 
>>> Robert
>>> 
>>>> 
>>>> Regards
>>>> Felix
>>>> 
>>>> Am 28.05.2013 um 16:52 schrieb Robert Munteanu:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> I've noticed a behaviour change when upgrading from SCR 1.6.0 to 1.6.2
>> .
>>>>> 
>>>>> In the Apache Sling project we have a component which binds service
>>>>> references in its own activate method, and expects them to be bound to
>>>>> itself later on ( see [0], near the end of the activate method ).
>>>>> 
>>>>> With SCR 1.6.0, these components are bound. With 1.6.2 they are not
>> bound.
>>>>> 
>>>>> I found nothing relevant to this edge case in the OSGi Declarative
>>>>> Services spec, so my question is : is this change intended or
>>>>> accidental?
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> Robert
>>>>> 
>>>>> 
>>>>> [0]:
>> http://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from my (old) computer
>>> 
>>> ---------------------------------------------------------------------
>>> 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
>> 
>> 
> 
> 
> -- 
> Mvh
> Snorre Lothar von Gohren Edwin
> +47 411 611 94


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


Mime
View raw message