You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Pierre-Gildas MILLON <pg...@gmail.com> on 2012/03/04 17:20:20 UTC

Embedded Felix & iPojo

Hi People,

I try to use iPojo in a Maven project that embed Felix.

I've followed the guidelines to embed Felix in an app and my simple bundle
that prints Hello World from the activator works fine.

Now I'd like to use iPojo to publish a service from my bundle (more
interesting than printing Hello World).
I'm using the annotations following the "Getting Started" from the iPojo
website.
But me service doesn't seem to be published.

If someone could help me, it's rather confusing.

The code is available :
https://gist.github.com/7bfc30226c6b1acad5e5

Regards,

Re: Embedded Felix & iPojo

Posted by Pierre-Gildas MILLON <pg...@gmail.com>.
I created a github project, it might be userful.

https://github.com/pgmillon/mySimpleBundle

Regards,

Pierre-Gildas

Le 04/03/2012 18:10, Pierre-Gildas MILLON a écrit :
> Hi Clement,
>
> Thanks for your quick answer but it does not solve the problem...
>
> Nothing on the console and when I try to get an instance of my service 
> through the API:
>
> ServiceReference< Service> serviceRef = 
> ctx.getServiceReference(Service.class);
> Service myService = ctx.getService(serviceRef);
>
> I've got a NPE:
>
> java.lang.NullPointerException: Specified service reference cannot be 
> null.
>
> :/
>
> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>> Hi,
>>
>> Add @Instantiate to your component class to instruct iPOJO to create an instance of your component:
>> @Component
>> @Provides
>> @Instantiate
>> public class ServiceImpl implements Service {
>>
>>
>> Regards,
>>
>> Clement
>>
>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>>
>>> Hi People,
>>>
>>> I try to use iPojo in a Maven project that embed Felix.
>>>
>>> I've followed the guidelines to embed Felix in an app and my simple bundle
>>> that prints Hello World from the activator works fine.
>>>
>>> Now I'd like to use iPojo to publish a service from my bundle (more
>>> interesting than printing Hello World).
>>> I'm using the annotations following the "Getting Started" from the iPojo
>>> website.
>>> But me service doesn't seem to be published.
>>>
>>> If someone could help me, it's rather confusing.
>>>
>>> The code is available :
>>> https://gist.github.com/7bfc30226c6b1acad5e5
>>>
>>> Regards,

Re: Embedded Felix & iPojo

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 06.03.2012, at 22:39, Pierre-Gildas MILLON wrote:

> Hi there,
> 
> I did add some packages to the FRAMEWORK_SYSTEMPACKAGES_EXTRA (the org.osgi.compendium bundle was missing).
> 
> Now my problem has evolved to the following :
> [WARNING] IPOJO-Extender : Type of component not available: component

It's just a timing issue. A component type is declared before the actual support for this type. Once the support is started, it will manage it as expected. 
Before getting the service be sure to 'wait'/'listen' enough time to let iPOJO finishes the startup process.

Regards,

Clement

> 
> The Arch Bundle throws the same warning...
> 
> Regards,
> 
> Pierre-Gildas
> 
> Le 06/03/2012 08:48, Pierre-Gildas MILLON a écrit :
>> Hi,
>> 
>> Thanks for your answer but I think I might have found a way out of this :)
>> I tried to declare a service from scratch: using Declarative Services then iPojo and at last iPojo Annotations.
>> Which lead me to a working bundle (I understood that the annotations were only used to generate content for the MANIFEST by the way).
>> Now, when I try to add this bundle into my embedded Felix I've got various errors of unresolved packages.
>> So, tonight I'll try to reconfigure the FRAMEWORK_SYSTEMPACKAGES_EXTRA variables and let you know how it ended.
>> 
>> Regards,
>> 
>> Pierre-Gildas
>> 
>> Le 6 mars 2012 08:43, Clement Escoffier <clement.escoffier@gmail.com <ma...@gmail.com>> a écrit :
>> 
>>    Hi,
>> 
>>    Did you try to add a @Validate method to check if the service
>>    object is created ?
>> 
>>    @Validate
>>    public void start() {
>>           System.out.println("starting…");
>>    }
>> 
>>    Moreover you can use the 'arch' command to check if the service is
>>    registered.
>> 
>>    Regards,
>> 
>>    Clement
>> 
>> 
>>    On 05.03.2012, at 19:46, Pierre-Gildas MILLON wrote:
>> 
>>    > Hi,
>>    >
>>    > I continue to try many things but I stiil fail to make that works...
>>    > The iPojo activator (Extender) seems to be well started but it
>>    doesn't initialize the service :/
>>    >
>>    > Le 04/03/2012 23:04, Pierre-Gildas MILLON a écrit :
>>    >> Hi,
>>    >>
>>    >> Not much luck with that...
>>    >>
>>    >> Regards,
>>    >>
>>    >> Pierre-Gildas
>>    >>
>>    >> Le 04/03/2012 19:30, Clement Escoffier a écrit :
>>    >>> Hi,
>>    >>>
>>    >>> Try to add the Service class package to
>>    Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
>>    >>> You need to ensure that it uses the same class inside and
>>    outside the framework.
>>    >>>
>>    >>> Regards,
>>    >>>
>>    >>> Clement
>>    >>>
>>    >>> On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:
>>    >>>
>>    >>>> Hi Clement,
>>    >>>>
>>    >>>> Thanks for your quick answer but it does not solve the problem...
>>    >>>>
>>    >>>> Nothing on the console and when I try to get an instance of
>>    my service through the API:
>>    >>>>
>>    >>>> ServiceReference<  Service>  serviceRef =
>>    ctx.getServiceReference(Service.class);
>>    >>>> Service myService = ctx.getService(serviceRef);
>>    >>>>
>>    >>>> I've got a NPE:
>>    >>>>
>>    >>>> java.lang.NullPointerException: Specified service reference
>>    cannot be null.
>>    >>>>
>>    >>>> :/
>>    >>>>
>>    >>>> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>>    >>>>> Hi,
>>    >>>>>
>>    >>>>> Add @Instantiate to your component class to instruct iPOJO
>>    to create an instance of your component:
>>    >>>>> @Component
>>    >>>>> @Provides
>>    >>>>> @Instantiate
>>    >>>>> public class ServiceImpl implements Service {
>>    >>>>>
>>    >>>>>
>>    >>>>> Regards,
>>    >>>>>
>>    >>>>> Clement
>>    >>>>>
>>    >>>>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>>    >>>>>
>>    >>>>>> Hi People,
>>    >>>>>>
>>    >>>>>> I try to use iPojo in a Maven project that embed Felix.
>>    >>>>>>
>>    >>>>>> I've followed the guidelines to embed Felix in an app and
>>    my simple bundle
>>    >>>>>> that prints Hello World from the activator works fine.
>>    >>>>>>
>>    >>>>>> Now I'd like to use iPojo to publish a service from my
>>    bundle (more
>>    >>>>>> interesting than printing Hello World).
>>    >>>>>> I'm using the annotations following the "Getting Started"
>>    from the iPojo
>>    >>>>>> website.
>>    >>>>>> But me service doesn't seem to be published.
>>    >>>>>>
>>    >>>>>> If someone could help me, it's rather confusing.
>>    >>>>>>
>>    >>>>>> The code is available :
>>    >>>>>> https://gist.github.com/7bfc30226c6b1acad5e5
>>    >>>>>>
>>    >>>>>> Regards,
>>    >>>
>>    >
>>    >
>>    ---------------------------------------------------------------------
>>    > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>    <ma...@felix.apache.org>
>>    > For additional commands, e-mail: users-help@felix.apache.org
>>    <ma...@felix.apache.org>
>>    >
>> 
>> 
>>    ---------------------------------------------------------------------
>>    To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>    <ma...@felix.apache.org>
>>    For additional commands, e-mail: users-help@felix.apache.org
>>    <ma...@felix.apache.org>
>> 
>> 


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


Re: Embedded Felix & iPojo

Posted by Pierre-Gildas MILLON <pg...@gmail.com>.
Hi there,

I did add some packages to the FRAMEWORK_SYSTEMPACKAGES_EXTRA (the 
org.osgi.compendium bundle was missing).

Now my problem has evolved to the following :
[WARNING] IPOJO-Extender : Type of component not available: component

The Arch Bundle throws the same warning...

Regards,

Pierre-Gildas

Le 06/03/2012 08:48, Pierre-Gildas MILLON a écrit :
> Hi,
>
> Thanks for your answer but I think I might have found a way out of this :)
> I tried to declare a service from scratch: using Declarative Services 
> then iPojo and at last iPojo Annotations.
> Which lead me to a working bundle (I understood that the annotations 
> were only used to generate content for the MANIFEST by the way).
> Now, when I try to add this bundle into my embedded Felix I've got 
> various errors of unresolved packages.
> So, tonight I'll try to reconfigure the FRAMEWORK_SYSTEMPACKAGES_EXTRA 
> variables and let you know how it ended.
>
> Regards,
>
> Pierre-Gildas
>
> Le 6 mars 2012 08:43, Clement Escoffier <clement.escoffier@gmail.com 
> <ma...@gmail.com>> a écrit :
>
>     Hi,
>
>     Did you try to add a @Validate method to check if the service
>     object is created ?
>
>     @Validate
>     public void start() {
>            System.out.println("starting…");
>     }
>
>     Moreover you can use the 'arch' command to check if the service is
>     registered.
>
>     Regards,
>
>     Clement
>
>
>     On 05.03.2012, at 19:46, Pierre-Gildas MILLON wrote:
>
>     > Hi,
>     >
>     > I continue to try many things but I stiil fail to make that works...
>     > The iPojo activator (Extender) seems to be well started but it
>     doesn't initialize the service :/
>     >
>     > Le 04/03/2012 23:04, Pierre-Gildas MILLON a écrit :
>     >> Hi,
>     >>
>     >> Not much luck with that...
>     >>
>     >> Regards,
>     >>
>     >> Pierre-Gildas
>     >>
>     >> Le 04/03/2012 19:30, Clement Escoffier a écrit :
>     >>> Hi,
>     >>>
>     >>> Try to add the Service class package to
>     Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
>     >>> You need to ensure that it uses the same class inside and
>     outside the framework.
>     >>>
>     >>> Regards,
>     >>>
>     >>> Clement
>     >>>
>     >>> On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:
>     >>>
>     >>>> Hi Clement,
>     >>>>
>     >>>> Thanks for your quick answer but it does not solve the problem...
>     >>>>
>     >>>> Nothing on the console and when I try to get an instance of
>     my service through the API:
>     >>>>
>     >>>> ServiceReference<  Service>  serviceRef =
>     ctx.getServiceReference(Service.class);
>     >>>> Service myService = ctx.getService(serviceRef);
>     >>>>
>     >>>> I've got a NPE:
>     >>>>
>     >>>> java.lang.NullPointerException: Specified service reference
>     cannot be null.
>     >>>>
>     >>>> :/
>     >>>>
>     >>>> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>     >>>>> Hi,
>     >>>>>
>     >>>>> Add @Instantiate to your component class to instruct iPOJO
>     to create an instance of your component:
>     >>>>> @Component
>     >>>>> @Provides
>     >>>>> @Instantiate
>     >>>>> public class ServiceImpl implements Service {
>     >>>>>
>     >>>>>
>     >>>>> Regards,
>     >>>>>
>     >>>>> Clement
>     >>>>>
>     >>>>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>     >>>>>
>     >>>>>> Hi People,
>     >>>>>>
>     >>>>>> I try to use iPojo in a Maven project that embed Felix.
>     >>>>>>
>     >>>>>> I've followed the guidelines to embed Felix in an app and
>     my simple bundle
>     >>>>>> that prints Hello World from the activator works fine.
>     >>>>>>
>     >>>>>> Now I'd like to use iPojo to publish a service from my
>     bundle (more
>     >>>>>> interesting than printing Hello World).
>     >>>>>> I'm using the annotations following the "Getting Started"
>     from the iPojo
>     >>>>>> website.
>     >>>>>> But me service doesn't seem to be published.
>     >>>>>>
>     >>>>>> If someone could help me, it's rather confusing.
>     >>>>>>
>     >>>>>> The code is available :
>     >>>>>> https://gist.github.com/7bfc30226c6b1acad5e5
>     >>>>>>
>     >>>>>> Regards,
>     >>>
>     >
>     >
>     ---------------------------------------------------------------------
>     > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>     <ma...@felix.apache.org>
>     > For additional commands, e-mail: users-help@felix.apache.org
>     <ma...@felix.apache.org>
>     >
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>     <ma...@felix.apache.org>
>     For additional commands, e-mail: users-help@felix.apache.org
>     <ma...@felix.apache.org>
>
>

Re: Embedded Felix & iPojo

Posted by Pierre-Gildas MILLON <pg...@gmail.com>.
Hi,

Thanks for your answer but I think I might have found a way out of this :)
I tried to declare a service from scratch: using Declarative Services then
iPojo and at last iPojo Annotations.
Which lead me to a working bundle (I understood that the annotations were
only used to generate content for the MANIFEST by the way).
Now, when I try to add this bundle into my embedded Felix I've got various
errors of unresolved packages.
So, tonight I'll try to reconfigure the FRAMEWORK_SYSTEMPACKAGES_EXTRA
variables and let you know how it ended.

Regards,

Pierre-Gildas

Le 6 mars 2012 08:43, Clement Escoffier <cl...@gmail.com> a
écrit :

> Hi,
>
> Did you try to add a @Validate method to check if the service object is
> created ?
>
> @Validate
> public void start() {
>        System.out.println("starting…");
> }
>
> Moreover you can use the 'arch' command to check if the service is
> registered.
>
> Regards,
>
> Clement
>
>
> On 05.03.2012, at 19:46, Pierre-Gildas MILLON wrote:
>
> > Hi,
> >
> > I continue to try many things but I stiil fail to make that works...
> > The iPojo activator (Extender) seems to be well started but it doesn't
> initialize the service :/
> >
> > Le 04/03/2012 23:04, Pierre-Gildas MILLON a écrit :
> >> Hi,
> >>
> >> Not much luck with that...
> >>
> >> Regards,
> >>
> >> Pierre-Gildas
> >>
> >> Le 04/03/2012 19:30, Clement Escoffier a écrit :
> >>> Hi,
> >>>
> >>> Try to add the Service class package to
> Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
> >>> You need to ensure that it uses the same class inside and outside the
> framework.
> >>>
> >>> Regards,
> >>>
> >>> Clement
> >>>
> >>> On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:
> >>>
> >>>> Hi Clement,
> >>>>
> >>>> Thanks for your quick answer but it does not solve the problem...
> >>>>
> >>>> Nothing on the console and when I try to get an instance of my
> service through the API:
> >>>>
> >>>> ServiceReference<  Service>  serviceRef =
> ctx.getServiceReference(Service.class);
> >>>> Service myService = ctx.getService(serviceRef);
> >>>>
> >>>> I've got a NPE:
> >>>>
> >>>> java.lang.NullPointerException: Specified service reference cannot be
> null.
> >>>>
> >>>> :/
> >>>>
> >>>> Le 04/03/2012 17:59, Clement Escoffier a écrit :
> >>>>> Hi,
> >>>>>
> >>>>> Add @Instantiate to your component class to instruct iPOJO to create
> an instance of your component:
> >>>>> @Component
> >>>>> @Provides
> >>>>> @Instantiate
> >>>>> public class ServiceImpl implements Service {
> >>>>>
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Clement
> >>>>>
> >>>>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
> >>>>>
> >>>>>> Hi People,
> >>>>>>
> >>>>>> I try to use iPojo in a Maven project that embed Felix.
> >>>>>>
> >>>>>> I've followed the guidelines to embed Felix in an app and my simple
> bundle
> >>>>>> that prints Hello World from the activator works fine.
> >>>>>>
> >>>>>> Now I'd like to use iPojo to publish a service from my bundle (more
> >>>>>> interesting than printing Hello World).
> >>>>>> I'm using the annotations following the "Getting Started" from the
> iPojo
> >>>>>> website.
> >>>>>> But me service doesn't seem to be published.
> >>>>>>
> >>>>>> If someone could help me, it's rather confusing.
> >>>>>>
> >>>>>> The code is available :
> >>>>>> https://gist.github.com/7bfc30226c6b1acad5e5
> >>>>>>
> >>>>>> Regards,
> >>>
> >
> > ---------------------------------------------------------------------
> > 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
>
>

Re: Embedded Felix & iPojo

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

Did you try to add a @Validate method to check if the service object is created ? 

@Validate
public void start() {
	System.out.println("starting…");
}

Moreover you can use the 'arch' command to check if the service is registered. 

Regards,

Clement


On 05.03.2012, at 19:46, Pierre-Gildas MILLON wrote:

> Hi,
> 
> I continue to try many things but I stiil fail to make that works...
> The iPojo activator (Extender) seems to be well started but it doesn't initialize the service :/
> 
> Le 04/03/2012 23:04, Pierre-Gildas MILLON a écrit :
>> Hi,
>> 
>> Not much luck with that...
>> 
>> Regards,
>> 
>> Pierre-Gildas
>> 
>> Le 04/03/2012 19:30, Clement Escoffier a écrit :
>>> Hi,
>>> 
>>> Try to add the Service class package to Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
>>> You need to ensure that it uses the same class inside and outside the framework.
>>> 
>>> Regards,
>>> 
>>> Clement
>>> 
>>> On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:
>>> 
>>>> Hi Clement,
>>>> 
>>>> Thanks for your quick answer but it does not solve the problem...
>>>> 
>>>> Nothing on the console and when I try to get an instance of my service through the API:
>>>> 
>>>> ServiceReference<  Service>  serviceRef = ctx.getServiceReference(Service.class);
>>>> Service myService = ctx.getService(serviceRef);
>>>> 
>>>> I've got a NPE:
>>>> 
>>>> java.lang.NullPointerException: Specified service reference cannot be null.
>>>> 
>>>> :/
>>>> 
>>>> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>>>>> Hi,
>>>>> 
>>>>> Add @Instantiate to your component class to instruct iPOJO to create an instance of your component:
>>>>> @Component
>>>>> @Provides
>>>>> @Instantiate
>>>>> public class ServiceImpl implements Service {
>>>>> 
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Clement
>>>>> 
>>>>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>>>>> 
>>>>>> Hi People,
>>>>>> 
>>>>>> I try to use iPojo in a Maven project that embed Felix.
>>>>>> 
>>>>>> I've followed the guidelines to embed Felix in an app and my simple bundle
>>>>>> that prints Hello World from the activator works fine.
>>>>>> 
>>>>>> Now I'd like to use iPojo to publish a service from my bundle (more
>>>>>> interesting than printing Hello World).
>>>>>> I'm using the annotations following the "Getting Started" from the iPojo
>>>>>> website.
>>>>>> But me service doesn't seem to be published.
>>>>>> 
>>>>>> If someone could help me, it's rather confusing.
>>>>>> 
>>>>>> The code is available :
>>>>>> https://gist.github.com/7bfc30226c6b1acad5e5
>>>>>> 
>>>>>> Regards,
>>> 
> 
> ---------------------------------------------------------------------
> 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


Re: Embedded Felix & iPojo

Posted by Pierre-Gildas MILLON <pg...@gmail.com>.
Hi,

I continue to try many things but I stiil fail to make that works...
The iPojo activator (Extender) seems to be well started but it doesn't 
initialize the service :/

Le 04/03/2012 23:04, Pierre-Gildas MILLON a écrit :
> Hi,
>
> Not much luck with that...
>
> Regards,
>
> Pierre-Gildas
>
> Le 04/03/2012 19:30, Clement Escoffier a écrit :
>> Hi,
>>
>> Try to add the Service class package to 
>> Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
>> You need to ensure that it uses the same class inside and outside the 
>> framework.
>>
>> Regards,
>>
>> Clement
>>
>> On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:
>>
>>> Hi Clement,
>>>
>>> Thanks for your quick answer but it does not solve the problem...
>>>
>>> Nothing on the console and when I try to get an instance of my 
>>> service through the API:
>>>
>>> ServiceReference<  Service>  serviceRef = 
>>> ctx.getServiceReference(Service.class);
>>> Service myService = ctx.getService(serviceRef);
>>>
>>> I've got a NPE:
>>>
>>> java.lang.NullPointerException: Specified service reference cannot 
>>> be null.
>>>
>>> :/
>>>
>>> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>>>> Hi,
>>>>
>>>> Add @Instantiate to your component class to instruct iPOJO to 
>>>> create an instance of your component:
>>>> @Component
>>>> @Provides
>>>> @Instantiate
>>>> public class ServiceImpl implements Service {
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Clement
>>>>
>>>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>>>>
>>>>> Hi People,
>>>>>
>>>>> I try to use iPojo in a Maven project that embed Felix.
>>>>>
>>>>> I've followed the guidelines to embed Felix in an app and my 
>>>>> simple bundle
>>>>> that prints Hello World from the activator works fine.
>>>>>
>>>>> Now I'd like to use iPojo to publish a service from my bundle (more
>>>>> interesting than printing Hello World).
>>>>> I'm using the annotations following the "Getting Started" from the 
>>>>> iPojo
>>>>> website.
>>>>> But me service doesn't seem to be published.
>>>>>
>>>>> If someone could help me, it's rather confusing.
>>>>>
>>>>> The code is available :
>>>>> https://gist.github.com/7bfc30226c6b1acad5e5
>>>>>
>>>>> Regards,
>>

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


Re: Embedded Felix & iPojo

Posted by Pierre-Gildas MILLON <pg...@gmail.com>.
Hi,

Not much luck with that...

Regards,

Pierre-Gildas

Le 04/03/2012 19:30, Clement Escoffier a écrit :
> Hi,
>
> Try to add the Service class package to Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
> You need to ensure that it uses the same class inside and outside the framework.
>
> Regards,
>
> Clement
>
> On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:
>
>> Hi Clement,
>>
>> Thanks for your quick answer but it does not solve the problem...
>>
>> Nothing on the console and when I try to get an instance of my service through the API:
>>
>> ServiceReference<  Service>  serviceRef = ctx.getServiceReference(Service.class);
>> Service myService = ctx.getService(serviceRef);
>>
>> I've got a NPE:
>>
>> java.lang.NullPointerException: Specified service reference cannot be null.
>>
>> :/
>>
>> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>>> Hi,
>>>
>>> Add @Instantiate to your component class to instruct iPOJO to create an instance of your component:
>>> @Component
>>> @Provides
>>> @Instantiate
>>> public class ServiceImpl implements Service {
>>>
>>>
>>> Regards,
>>>
>>> Clement
>>>
>>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>>>
>>>> Hi People,
>>>>
>>>> I try to use iPojo in a Maven project that embed Felix.
>>>>
>>>> I've followed the guidelines to embed Felix in an app and my simple bundle
>>>> that prints Hello World from the activator works fine.
>>>>
>>>> Now I'd like to use iPojo to publish a service from my bundle (more
>>>> interesting than printing Hello World).
>>>> I'm using the annotations following the "Getting Started" from the iPojo
>>>> website.
>>>> But me service doesn't seem to be published.
>>>>
>>>> If someone could help me, it's rather confusing.
>>>>
>>>> The code is available :
>>>> https://gist.github.com/7bfc30226c6b1acad5e5
>>>>
>>>> Regards,
>

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


Re: Embedded Felix & iPojo

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

Try to add the Service class package to Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA.
You need to ensure that it uses the same class inside and outside the framework.

Regards,

Clement

On 04.03.2012, at 18:10, Pierre-Gildas MILLON wrote:

> Hi Clement,
> 
> Thanks for your quick answer but it does not solve the problem...
> 
> Nothing on the console and when I try to get an instance of my service through the API:
> 
> ServiceReference< Service> serviceRef = ctx.getServiceReference(Service.class);
> Service myService = ctx.getService(serviceRef);
> 
> I've got a NPE:
> 
> java.lang.NullPointerException: Specified service reference cannot be null.
> 
> :/
> 
> Le 04/03/2012 17:59, Clement Escoffier a écrit :
>> Hi,
>> 
>> Add @Instantiate to your component class to instruct iPOJO to create an instance of your component:
>> @Component
>> @Provides
>> @Instantiate
>> public class ServiceImpl implements Service {
>> 
>> 
>> Regards,
>> 
>> Clement
>> 
>> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>> 
>>> Hi People,
>>> 
>>> I try to use iPojo in a Maven project that embed Felix.
>>> 
>>> I've followed the guidelines to embed Felix in an app and my simple bundle
>>> that prints Hello World from the activator works fine.
>>> 
>>> Now I'd like to use iPojo to publish a service from my bundle (more
>>> interesting than printing Hello World).
>>> I'm using the annotations following the "Getting Started" from the iPojo
>>> website.
>>> But me service doesn't seem to be published.
>>> 
>>> If someone could help me, it's rather confusing.
>>> 
>>> The code is available :
>>> https://gist.github.com/7bfc30226c6b1acad5e5
>>> 
>>> Regards,
>> 


Re: Embedded Felix & iPojo

Posted by Pierre-Gildas MILLON <pg...@gmail.com>.
Hi Clement,

Thanks for your quick answer but it does not solve the problem...

Nothing on the console and when I try to get an instance of my service 
through the API:

ServiceReference< Service> serviceRef = 
ctx.getServiceReference(Service.class);
Service myService = ctx.getService(serviceRef);

I've got a NPE:

java.lang.NullPointerException: Specified service reference cannot be null.

:/

Le 04/03/2012 17:59, Clement Escoffier a écrit :
> Hi,
>
> Add @Instantiate to your component class to instruct iPOJO to create an instance of your component:
> @Component
> @Provides
> @Instantiate
> public class ServiceImpl implements Service {
>
>
> Regards,
>
> Clement
>
> On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:
>
>> Hi People,
>>
>> I try to use iPojo in a Maven project that embed Felix.
>>
>> I've followed the guidelines to embed Felix in an app and my simple bundle
>> that prints Hello World from the activator works fine.
>>
>> Now I'd like to use iPojo to publish a service from my bundle (more
>> interesting than printing Hello World).
>> I'm using the annotations following the "Getting Started" from the iPojo
>> website.
>> But me service doesn't seem to be published.
>>
>> If someone could help me, it's rather confusing.
>>
>> The code is available :
>> https://gist.github.com/7bfc30226c6b1acad5e5
>>
>> Regards,
>

Re: Embedded Felix & iPojo

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

Add @Instantiate to your component class to instruct iPOJO to create an instance of your component:
@Component
@Provides
@Instantiate
public class ServiceImpl implements Service {


Regards,

Clement

On 04.03.2012, at 17:20, Pierre-Gildas MILLON wrote:

> Hi People,
> 
> I try to use iPojo in a Maven project that embed Felix.
> 
> I've followed the guidelines to embed Felix in an app and my simple bundle
> that prints Hello World from the activator works fine.
> 
> Now I'd like to use iPojo to publish a service from my bundle (more
> interesting than printing Hello World).
> I'm using the annotations following the "Getting Started" from the iPojo
> website.
> But me service doesn't seem to be published.
> 
> If someone could help me, it's rather confusing.
> 
> The code is available :
> https://gist.github.com/7bfc30226c6b1acad5e5
> 
> Regards,