Hi,

I have just started learning iPojo as the component framework for my karaf
application.

I tried their maven tutorial, which has three bundles, interface, service
provider, and client.
It uses metadata.xml to provide meta data for iPojo. It worked fine as
expected.

When I moved onto annotation based approach, I did the followings.
  - removed metadata.xml from service provider and client
  - added dependency to ipojo annotation package
  - added annotations to the service provider source code and client source
code

However, it did not work.

By having a closer look, it turned out that the client was working fine but
the service
provider was not working properly.

The annotations I added to the service provider class were
  - @Component      and
  - @Provides
as shown on their annotation tutorial.


The bundle state on the web client showed some difference between xml based
service
provider and the annotation based service provider.

XML based service provider's status shows:

Service ID 183 Types: org.apache.felix.ipojo.extender.TypeDeclaration
Service ID 184 Types: org.apache.felix.ipojo.extender.InstanceDeclaration
Service ID 185 Types: org.apache.felix.ipojo.Factory
                Service PID: HelloProviderrr
Service ID 186 Types: org.apache.felix.ipojo.architecture.Architecture
Service ID 187 Types: ipojo.example.hello.Hello


while Annotation based one does not show Service ID 183, 186, or 187.
And also iPOJO-Components does not have instance attribute, which exists in
XML based version. It looks like the instance attribute was created from
<instance> element of the metadata.xml.


Could somebody tell me how to fix the difference?

thank you,
Harunobu Oyama

Reply via email to