Hi Snorre,

No I'm sorry, but none of this is clear at all! For example you keep
talking about "doing something to a null object". What do you mean?? What
is a null object? Where did the null object come from, what is the
"something" you are trying to do? Then you said that "the code stops". What
code?? In what way does it stop... does it throw an exception? Do you see
some kind of error... or a deadlock??

So, please answer the following questions as clearly and specifically as
possible, without assuming that we already know anything about what your
assignment is:

1) What am I trying to achieve;
2) What did I try to do;
3) What did I *expect* to see as the result of doing (2);
4) What did I *actually* see as a result of doing (2);
5) Why do I believe that what actually happened is wrong?

With regard to your reference method not being called... how is this an
error? You have defined a mandatory reference to a service, so if that
service does not exist then your component should not be activated. If the
"lableupdated.Api" service becomes available later then you component will
be activated at that time. So this is not an error, it is correct
behaviour. If you expected to see the component activated, then you can use
the scr:list and scr:info commands from the Gogo shell to diagnose.

Regards,
Neil


On Tue, May 28, 2013 at 10:50 PM, Snorre Lothar von Gohren Edwin <
[email protected]> wrote:

> Ok il try again. Because its actually really basic and simple.
> https://github.com/Snorlock/prosjektoppgavekode/tree/troubles
>
> No need to clone, I can explain it here. A disclaimer, this is not business
> project, its for my assignment and the way im learning OSGi, so just ignore
> stupid variables and stupid stuff for now ^^
>
> If you take a look at the repo provided above. Focus on roadstation package
> and labelupdater packages. This class is inside roadstation:
> http://goo.gl/Qp85a
> Right now all that is connected is the *roadstation*, *lableupdater *and *
> labelupdater.impl.* The labelupdater provides a service api. And
> labelupdate.impl is the service implementation.
>
> Roadsatation Activatorzzz is the DS component im trying to play around
> with. First problem is that if I don't resolve my labelupdater.impl, the
> @Reference method in Activatorzzz(see the refrences class link) is not
> triggered, and the bundle goes into active. Shouldn't there be some sort of
> logging message or callback telling that since there is no implementations,
> this @Reference method wont be triggered.
>
> Second, doing something to a null object, that might be a mistake one have
> done somewhere in the code, the code stops. I know the method is triggered
> because it prints out my text before the null object, but not after. Then I
> refere to the activate method.
>
> I know this is really newbie stuff but for some reason i feel that its
> important with callbacks when something that is wrong goes wrong.
> But is this clearer now?
>
> And I feel that I almost have to apologize for bringing this kind of stuff
> to the mailing list, but all i have of source of information when im really
> stuck is this list and the #karaf irc channel. For some reason I dont use
> stackoverflow for OSGi related questions. Feel that it might take to long
> of a time to get a respons.
>
>
>
>
> On Tue, May 28, 2013 at 11:26 PM, David Jencks <[email protected]
> >wrote:
>
> > 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 <
> > [email protected]> 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 <[email protected]
> > >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 <[email protected]> wrote:
> > >>
> > >>> On Tue, May 28, 2013 at 5:55 PM, Felix Meschberger <
> [email protected]
> > >
> > >> 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: [email protected]
> > >>>>> For additional commands, e-mail: [email protected]
> > >>>>>
> > >>>>
> > >>>>
> > >>>>
> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: [email protected]
> > >>>> For additional commands, e-mail: [email protected]
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> Sent from my (old) computer
> > >>>
> > >>> ---------------------------------------------------------------------
> > >>> 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]
> > >>
> > >>
> > >
> > >
> > > --
> > > Mvh
> > > Snorre Lothar von Gohren Edwin
> > > +47 411 611 94
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Mvh
> Snorre Lothar von Gohren Edwin
> +47 411 611 94
>

Reply via email to