You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by lessonz <le...@gmail.com> on 2012/10/19 03:14:53 UTC

IPOJO Interface Issues

I’m using IPOJO.


Okay, I’ve got one that has me stumped. I have a component with some member
components:


@Component

@Instantiate

@Provides

public class SampleServiceImpl implements ISampleService {

                @Requires

                private ITestAService testAService;

                @Requires

                private ITestBService testBService;

.

.

.

}


If I have the interface ITestAService extend ICoreService everything seems
to work just fine, but if I have ITestBService extend ICoreService then
ITestBService and SampleServiceImpl never register. This really doesn’t
make any sense to me. There doesn’t appear to be any rhyme or reason to it.
As I don't understand how this is possible, it's entirely possible I'm
missing something that is material to the conversation. I'm just not sure
what it is. I'd love any ideas about where to look.


Our architecture would ideally have ISampleService, ITestAService, and
ITestBService all have ICoreService as a super-interface. The documentation
seems to indicate this should be possible, but for some reason I can’t get
it to work. Am I missing something?


Thanks

Re: IPOJO Interface Issues

Posted by Göktürk Gezer <go...@gmail.com>.
Hi,

Could you share your generated manifest files (MANIFEST.MF) for both API
and implementation bundles?

In the mean time you could try to add your ICoreService's package name to
implementation bundle's import section manually if it's not already there.

Regards,
Göktürk
On Oct 20, 2012 2:37 AM, "lessonz" <le...@gmail.com> wrote:

> Okay, so I realized I'd been ignoring an error. There is an error I'd be
> unintentionally ignoring:
>
>         [Thread-1] ERROR com.sample.bundle - [ERROR]
> com.sample.SampleServiceImpl : Service Providing: The service specification
> com.sample.ICoreService cannot be load
>
> Okay, this happened when I had ISampleService extend ICoreService. Some
> other details. SampleServiceImpl  is in one bundle. Both ISampleService and
> ICoreService are in one, but a different, bundle. They are in different
> packages, but the bundle exports both of these packages. The ICoreService
> interface has 0 imports. I see the error even if I have SampleServiceImpl
> import ICoreService directly. If I make ISampleService NOT extend
> ICoreService, the error goes away (makes sense) and SampleServiceImpl gets
> instantiated no problem.
>
> Any ideas would be greatly appreciated.
>
> Thanks
> On Oct 18, 2012 7:14 PM, "lessonz" <le...@gmail.com> wrote:
>
> > I’m using IPOJO.
> >
> >
> > Okay, I’ve got one that has me stumped. I have a component with some
> > member components:
> >
> >
> > @Component
> >
> > @Instantiate
> >
> > @Provides
> >
> > public class SampleServiceImpl implements ISampleService {
> >
> >                 @Requires
> >
> >                 private ITestAService testAService;
> >
> >                 @Requires
> >
> >                 private ITestBService testBService;
> >
> > .
> >
> > .
> >
> > .
> >
> > }
> >
> >
> > If I have the interface ITestAService extend ICoreService everything
> seems
> > to work just fine, but if I have ITestBService extend ICoreService then
> > ITestBService and SampleServiceImpl never register. This really doesn’t
> > make any sense to me. There doesn’t appear to be any rhyme or reason to
> it.
> > As I don't understand how this is possible, it's entirely possible I'm
> > missing something that is material to the conversation. I'm just not sure
> > what it is. I'd love any ideas about where to look.
> >
> >
> > Our architecture would ideally have ISampleService, ITestAService, and
> > ITestBService all have ICoreService as a super-interface. The
> documentation
> > seems to indicate this should be possible, but for some reason I can’t
> get
> > it to work. Am I missing something?
> >
> >
> > Thanks
> >
>

Re: IPOJO Interface Issues

Posted by lessonz <le...@gmail.com>.
Thank you both. It turns out my bundle was not importing the package of the
super-interface. Manually adding it to the Import-Package in the manifest
resolved the issue. Is this a bug in the maven-bundle-plugin? I did a quick
search on Jira, but I saw no mention of this problem. I don't mind filing
an issue, but is this working as intended? Am I missing something?

Thanks again.

On Sat, Oct 20, 2012 at 1:40 AM, Clement Escoffier <
clement.escoffier@gmail.com> wrote:

> Hi,
>
> The error means that iPOJO can't load the interface. IT's required to be
> sure that the POJO is able to server the service.
> Your bundle containing your components must import the package of the
> interfaces as well as the packages of the parent interfaces. I suspect that
> the 2 interfaces are in 2 different packages.
>
> So, if you have this:
> The bundle A contains and exports my.package.interfaces (containing
> ISampleService) and my.package.interfaces.parent containing (ICoreService)
> The bundle B with my.package.impl.MyComponent.class must import
> my.package.interfaces AND my.package.interfaces.parent
>
> Could you, as Göktürk suggested, send us your manifest of the 2 bundles.
>
> Regards,
>
> Clement
>
>
> On 20 oct. 2012, at 01:36, lessonz <le...@gmail.com> wrote:
>
> > Okay, so I realized I'd been ignoring an error. There is an error I'd be
> > unintentionally ignoring:
> >
> >        [Thread-1] ERROR com.sample.bundle - [ERROR]
> > com.sample.SampleServiceImpl : Service Providing: The service
> specification
> > com.sample.ICoreService cannot be load
> >
> > Okay, this happened when I had ISampleService extend ICoreService. Some
> > other details. SampleServiceImpl  is in one bundle. Both ISampleService
> and
> > ICoreService are in one, but a different, bundle. They are in different
> > packages, but the bundle exports both of these packages. The ICoreService
> > interface has 0 imports. I see the error even if I have SampleServiceImpl
> > import ICoreService directly. If I make ISampleService NOT extend
> > ICoreService, the error goes away (makes sense) and SampleServiceImpl
> gets
> > instantiated no problem.
> >
> > Any ideas would be greatly appreciated.
> >
> > Thanks
> > On Oct 18, 2012 7:14 PM, "lessonz" <le...@gmail.com> wrote:
> >
> >> I’m using IPOJO.
> >>
> >>
> >> Okay, I’ve got one that has me stumped. I have a component with some
> >> member components:
> >>
> >>
> >> @Component
> >>
> >> @Instantiate
> >>
> >> @Provides
> >>
> >> public class SampleServiceImpl implements ISampleService {
> >>
> >>                @Requires
> >>
> >>                private ITestAService testAService;
> >>
> >>                @Requires
> >>
> >>                private ITestBService testBService;
> >>
> >> .
> >>
> >> .
> >>
> >> .
> >>
> >> }
> >>
> >>
> >> If I have the interface ITestAService extend ICoreService everything
> seems
> >> to work just fine, but if I have ITestBService extend ICoreService then
> >> ITestBService and SampleServiceImpl never register. This really doesn’t
> >> make any sense to me. There doesn’t appear to be any rhyme or reason to
> it.
> >> As I don't understand how this is possible, it's entirely possible I'm
> >> missing something that is material to the conversation. I'm just not
> sure
> >> what it is. I'd love any ideas about where to look.
> >>
> >>
> >> Our architecture would ideally have ISampleService, ITestAService, and
> >> ITestBService all have ICoreService as a super-interface. The
> documentation
> >> seems to indicate this should be possible, but for some reason I can’t
> get
> >> it to work. Am I missing something?
> >>
> >>
> >> Thanks
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: IPOJO Interface Issues

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

The error means that iPOJO can't load the interface. IT's required to be sure that the POJO is able to server the service.
Your bundle containing your components must import the package of the interfaces as well as the packages of the parent interfaces. I suspect that the 2 interfaces are in 2 different packages.

So, if you have this:
The bundle A contains and exports my.package.interfaces (containing ISampleService) and my.package.interfaces.parent containing (ICoreService)
The bundle B with my.package.impl.MyComponent.class must import my.package.interfaces AND my.package.interfaces.parent

Could you, as Göktürk suggested, send us your manifest of the 2 bundles.

Regards,

Clement


On 20 oct. 2012, at 01:36, lessonz <le...@gmail.com> wrote:

> Okay, so I realized I'd been ignoring an error. There is an error I'd be
> unintentionally ignoring:
> 
>        [Thread-1] ERROR com.sample.bundle - [ERROR]
> com.sample.SampleServiceImpl : Service Providing: The service specification
> com.sample.ICoreService cannot be load
> 
> Okay, this happened when I had ISampleService extend ICoreService. Some
> other details. SampleServiceImpl  is in one bundle. Both ISampleService and
> ICoreService are in one, but a different, bundle. They are in different
> packages, but the bundle exports both of these packages. The ICoreService
> interface has 0 imports. I see the error even if I have SampleServiceImpl
> import ICoreService directly. If I make ISampleService NOT extend
> ICoreService, the error goes away (makes sense) and SampleServiceImpl gets
> instantiated no problem.
> 
> Any ideas would be greatly appreciated.
> 
> Thanks
> On Oct 18, 2012 7:14 PM, "lessonz" <le...@gmail.com> wrote:
> 
>> I’m using IPOJO.
>> 
>> 
>> Okay, I’ve got one that has me stumped. I have a component with some
>> member components:
>> 
>> 
>> @Component
>> 
>> @Instantiate
>> 
>> @Provides
>> 
>> public class SampleServiceImpl implements ISampleService {
>> 
>>                @Requires
>> 
>>                private ITestAService testAService;
>> 
>>                @Requires
>> 
>>                private ITestBService testBService;
>> 
>> .
>> 
>> .
>> 
>> .
>> 
>> }
>> 
>> 
>> If I have the interface ITestAService extend ICoreService everything seems
>> to work just fine, but if I have ITestBService extend ICoreService then
>> ITestBService and SampleServiceImpl never register. This really doesn’t
>> make any sense to me. There doesn’t appear to be any rhyme or reason to it.
>> As I don't understand how this is possible, it's entirely possible I'm
>> missing something that is material to the conversation. I'm just not sure
>> what it is. I'd love any ideas about where to look.
>> 
>> 
>> Our architecture would ideally have ISampleService, ITestAService, and
>> ITestBService all have ICoreService as a super-interface. The documentation
>> seems to indicate this should be possible, but for some reason I can’t get
>> it to work. Am I missing something?
>> 
>> 
>> Thanks
>> 


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


Re: IPOJO Interface Issues

Posted by lessonz <le...@gmail.com>.
Okay, so I realized I'd been ignoring an error. There is an error I'd be
unintentionally ignoring:

        [Thread-1] ERROR com.sample.bundle - [ERROR]
com.sample.SampleServiceImpl : Service Providing: The service specification
com.sample.ICoreService cannot be load

Okay, this happened when I had ISampleService extend ICoreService. Some
other details. SampleServiceImpl  is in one bundle. Both ISampleService and
ICoreService are in one, but a different, bundle. They are in different
packages, but the bundle exports both of these packages. The ICoreService
interface has 0 imports. I see the error even if I have SampleServiceImpl
import ICoreService directly. If I make ISampleService NOT extend
ICoreService, the error goes away (makes sense) and SampleServiceImpl gets
instantiated no problem.

Any ideas would be greatly appreciated.

Thanks
On Oct 18, 2012 7:14 PM, "lessonz" <le...@gmail.com> wrote:

> I’m using IPOJO.
>
>
> Okay, I’ve got one that has me stumped. I have a component with some
> member components:
>
>
> @Component
>
> @Instantiate
>
> @Provides
>
> public class SampleServiceImpl implements ISampleService {
>
>                 @Requires
>
>                 private ITestAService testAService;
>
>                 @Requires
>
>                 private ITestBService testBService;
>
> .
>
> .
>
> .
>
> }
>
>
> If I have the interface ITestAService extend ICoreService everything seems
> to work just fine, but if I have ITestBService extend ICoreService then
> ITestBService and SampleServiceImpl never register. This really doesn’t
> make any sense to me. There doesn’t appear to be any rhyme or reason to it.
> As I don't understand how this is possible, it's entirely possible I'm
> missing something that is material to the conversation. I'm just not sure
> what it is. I'd love any ideas about where to look.
>
>
> Our architecture would ideally have ISampleService, ITestAService, and
> ITestBService all have ICoreService as a super-interface. The documentation
> seems to indicate this should be possible, but for some reason I can’t get
> it to work. Am I missing something?
>
>
> Thanks
>