Hi,
The handler is instantiated in the composite service scope, which
means that it tries to find the event admin service in the composite
scope. So, you need to import the event admin inside the composite too:
Deploy the event admin in OSGi, and then add in your composite
description:
<requires action="import"
specification="org.osgi.service.event.EventAdmin"/>
This will imports the Event Admin service inside the composite.
However, as the EA is also based on an whiteboard pattern for the
event delivery, you have to export the EventHandlers to the OSGi scope
with:
<provides action="export"
specification="org.osgi.service.event.EventHandler" aggregate="true"/>
Regards,
Clement
PS: Check the specification parameters, it has to be the exact service
interface names :-)
On 13.11.2009, at 16:34, Sylvain Desvé wrote:
Hi everybody,
I'm learning iPojo with the various tutorials I found on the official
website and I came across the following problem :
To test asynchronous communication, I defined 3 iPojos :
- a dictionary service implementation (which I slowed down with a
Thread.sleep)
- a spell checker service implementation which checks spelling in a
separate Thread and publish the result on a specific topic
- a spell checker gui which sends the String and updates when
receiving the
result
When I use the following instanciation, everything works perfecly :
<instance
component="org.kookoolen.learning.spell.dictionary.LowDictionary"/>
<instance
component
="org.kookoolen.learning.spell.checker.AsynchronousSpellCheck" />
<instance
component
="org.kookoolen.learning.spell.gui.AsynchronousSpellCheckerGui" />
On the contrary, when I try the same in a composite, the Spell
checker is
invalid :
<composite name="async-spell-checker-application">
<instance
component="org.kookoolen.learning.spell.dictionary.LowDictionary"/>
<instance
component
="org.kookoolen.learning.spell.checker.AsynchronousSpellCheck" />
<instance
component
="org.kookoolen.learning.spell.gui.AsynchronousSpellCheckerGui" />
</composite>
I get the following in the spell checker service description (using
the web
console) inside the composite:
[...]
handler name="org.apache.felix.ipojo.handlers.event:publisher"
state="invalid"
[...]
Thanks for your help !
Sylvain
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]