Hi,

Your Bot should import the uk.co.talkingcode.ipojorc.api package. If not, iPOJO can't access the Command interface when creating the array.
Just modify your import-packages of the Bot bundle to be:

sun.io;resolution:=optional,
javax.xml.parsers,
org.w3c.dom,
org.xml.sax,
org.xml.sax.ext,
org.xml.sax.helpers,
org.slf4j.*;resolution:=optional,
uk.co.talkingcode.ipojorc.api  <-- Add this one

And then, it should works (quickly tried on my machine, and it works :-)).

However, I was expecting a better error message from the Java when this kind of error occurs, I will improve that, because the error is definitely misleading.

Regards,

Clement


On 13.05.2009, at 08:27, Arthur Taylor wrote:

Hi,

Probably a stupid question, but I'm getting an ArrayStoreException from
the framework when I try and use an injected aggregate service field:

1242195106334 ### java.lang.ArrayStoreException:
uk.co.talkingcode.ipojorc.commands.echo.Echo
1242195106334 ###       at
org .apache .felix .ipojo .handlers.dependency.Dependency.createServiceObject(Dependency.java: 484)
1242195106334 ###       at
org .apache .felix.ipojo.handlers.dependency.Dependency.onGet(Dependency.java:448)
1242195106334 ###       at
org.apache.felix.ipojo.InstanceManager.onGet(InstanceManager.java:893)
1242195106334 ###       at
uk.co.talkingcode.ipojorc.core.Bot.__getcommands(Bot.java)
1242195106334 ###       at
uk.co.talkingcode.ipojorc.core.Bot.__onMessage(Bot.java:60)
1242195106334 ###       at
uk.co.talkingcode.ipojorc.core.Bot.onMessage(Bot.java)
1242195106334 ###       at
org.jibble.pircbot.PircBot.handleLine(PircBot.java:927)
1242195106334 ###       at
org.jibble.pircbot.InputThread.run(InputThread.java:95)

The problem seems to be that the Echo object is being inserted into an
array of IRCCommand, but (at least pre-weaving) Echo implements
IRCCommand so I don't expect that to be a problem. Source is here:

http://github.com/codders/ipojorc/blob/d8968531199600cda399a7aa3980a21b00ddc66a/bundles/echo/src/main/java/uk/co/talkingcode/ipojorc/commands/echo/Echo.java
http://github.com/codders/ipojorc/blob/d8968531199600cda399a7aa3980a21b00ddc66a/bundles/core/src/main/java/uk/co/talkingcode/ipojorc/core/Bot.java
http://github.com/codders/ipojorc/blob/d8968531199600cda399a7aa3980a21b00ddc66a/bundles/api/src/main/java/uk/co/talkingcode/ipojorc/api/IRCCommand.java

metadata.xml for the two bundles ('core' being the consumer and 'echo'
being the provider) are here:

http://github.com/codders/ipojorc/blob/d8968531199600cda399a7aa3980a21b00ddc66a/bundles/core/metadata.xml
http://github.com/codders/ipojorc/blob/d8968531199600cda399a7aa3980a21b00ddc66a/bundles/echo/metadata.xml

I'm basically trying to do this as my Hello World for iPOJO and
implement the program outlined here:

http://www.theserverside.com/tt/articles/article.tss?l=WhiteboardForOSGi

but with iPOJO.

Any help would be greatly appreciated.

Arthur

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to