This can sound stupid but, are you sure that the eventAdmin bundle is active in your independent equinox environment?

Asier Aranbarri Beldarrain escribió:
Hi Neil:

I'm using Eclipse's plug-in development tool (equinox). I made several attempts and inside eclipse, with the same configuration, everything seems to be ok. But when exporting it (I have an independent equinox environment, with an "osgi.exe" , it doesn't seem to work. I'm not sure what you are refering to when you say that the listener doesn't import the package, since the listener and poster have the same build configuration.
Thanks for your help, appreciated ,

Asier

On 30 March 2010 14:19, Neil Bartlett <[email protected] <mailto:[email protected]>> wrote:

    The listener bundle is not importing the package
    "org.osgi.service.event".

    This should have been caught at build-time. What development
    environment or OSGi tooling are you using? Eclipse PDE would show this
    as a compilation error, and bnd (or a bnd-based tool such as Maven's
    bundle plugin) would automatically add the import.

    Regards
    Neil

    On 3/30/10, Asier Aranbarri Beldarrain <[email protected]
    <mailto:[email protected]>> wrote:
    > Hi all*:
    >
    > *I am having some trouble with osgi "event" services;
    > What I have is really simple: An event poster and a listener.
    One sends an
    > string and the second one just receives it and prints it.
    >
    > I'm making it in Eclipse and it executes OK there, but my
    problem appears
    > when I export the bundles ( to separate .jar bundles) and try to
    execute
    > them on an independent equinox framework.
    > Also, when I export the bundles, I make sure that the libraries
    that include
    > the service.Event class are included in the classpath. In my
    case, I use "*
    > org.osgi.compendium-1.4.0.jar*" .
    > I printed the error so you can see it properly. I also send the
    resumed code
    > of the two bundles (the part of sending and receiving events).
    >
    > Any help would be appreciated. Thanks!
    > *
    >
    >   EVENT POSTER*
    >
    >   *     private static final String POST_EVENT_QUEUE = "1234";*
    >
    >         Hashtable props = new Properties();
    >         props.put("property",(XXX.toString() );
    >         Event event = new Event(POST_EVENT_QUEUE,
    (Dictionary)props);
    >         eventAdmin.postEvent(event);
    >
    > *  EVENT LISTENER*
    >
    > *    private static final String POST_EVENT_QUEUE = "1234";*
    >
    >       Dictionary dp = new Hashtable();
    >       dp.put(EventConstants.EVENT_TOPIC, POST_EVENT_QUEUE);
    >       context.registerService(EventHandler.class.getName(), new *
    > PostEventHandler*(), dp);  ----> *PostEventHandler*()-->does--->
     * String
    > value = event.getProperty("property"); System.out.println(value);*
    >
    _______________________________________________
    OSGi Developer Mail List
    [email protected] <mailto:[email protected]>
    https://mail.osgi.org/mailman/listinfo/osgi-dev


------------------------------------------------------------------------

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to