Daniel,
You are on the right track. Sorry, I should have mentioned this before. The
classes from which @Scope annotations are processed in implementation.osgi
should be listed under the attribute "classes" in <implementation.osgi/> in
the composite file.
<implementation.osgi
xmlns=http://tuscany.apache.org/xmlns/sca/1.0bundleSymbolicName="gamma"
classes="services.GammaImpl"/>
There are some examples which use servicefactory in
itest/osgi-implementation (eg. factory-ds-test.composite). Most annotations
like @Property are processed from the implementation class of the service
(GammaImpl) once the service instance is obtained, even if the class is not
listed in <implementation.osgi/>. But since scope needs to be determined
before the service instance is obtained from OSGi, the class(es) from which
@Scope annotation is processed should be listed in the composite file.
On 4/7/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi Radjini,
>
> > You cannot set servicefactory to true inside an immediate
> > component. Since the service is not registered by OSGi DS in
> > the OSGi registry in this case, implementation.osgi never
> > finds it - hence the infinite loop.
>
> Yes, configuring it in this way makes no sense. A warning would be nice
> :-)
>
>
> > With immediate=false, I would have expected a new instance to
> > be created for Gamma for each conversation.
> >
> > Could you check if the following are true?
> >
> >
> > 1. GammaImpl should contain the annotation
> > @Scope("CONVERSATION") on
> > the class. Not necessarily conversation - anything other
> > than COMPOSITE.
>
> Yes, this is true. It is marked with @Scope("CONVERSATION")
>
>
> > 2. The bundle containing GammaImpl should import
> > org.osoa.sca.annotations
> > (ie. @Scope annotation should be visible from the bundle)
>
> Yes, this is also true
>
>
> > 3. If 1) and 2) are true, could you breakpoint in the
> > constructor of
> > GammaImpl (or anywhere in that class) and check that you
> > have a bundle
> > installed with name "dummy.sca.xxxxx"? implementation.osgi
> > should be using a
> > dummy bundle to get a reference to the Gamma service if it
> > has identified
> > that the scope is not composite.
>
> I could not see a bundle "dummy.sca.*" in the equinox console.
>
> While debugging, I noticed the following in class OSGiInstanceWrapper:
> In line 119
> if (!annotationProcessor.getScope().equals(Scope.COMPOSITE))
> the getScope() returns "COMPOSITE", not "CONVERSATION"
> So line 118
> refBundle = getDummyReferenceBundle();
> is not executed
>
> So it seems that the annotation was not found or not processed
> correctly.
>
> After some further debugging:
>
> In OSGiImplementationProvider in line 162 implementation.getClassList()
> returns an empty list.
> Therefore method processAnnotations() of class OSGiAnnotations has no
> classes to iterate over an leaves the default scope to "COMPOSITE".
> Maybe there's something missing in the bundles manifest file ? What
> should be included in this calls list and where/how is it configured.
> Or am I on a wrong track ?
>
>
> Bye,
> Daniel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Thank you...
Regards,
Rajini