Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

iCal4j 1.0.4 - OSGi bundle not working for me

Help
2013-05-02
2013-09-10
  • Hey all,

    i recently tried to add the iCal4j bundle to my project an got the following error message during bundle start:

    org.osgi.framework.BundleException: Unresolved constraint in bundle org.mnode.ical4j [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package;(osgi.wiring.package=net.fortuna.ical4j)
    

    This also happens, if a deploy the bundle to a fresh and clean Felix 4.2.1 runtime. Seems to me, that the following statement in the file MANIFEST.MF is the cause for this:

    Import-Package: ..., net.fortuna.ical4j, ...
    

    Am I doing something wrong here? Does anyone have the bundle version 1.0.4 successfully running in an OSGi container and knows, what could be the cause for my problem.

    Your will be greatly appreciated!

    Cheers,

    Johannes

     
  • Ben Fortuna
    Ben Fortuna
    2013-09-10

    Hi Johannes,

    I have just been testing the ical4j bundle in an OSGi environment and can confirm the issue you are seeing. I have made some changes to the way the manifest is generated, but there are some implications from the backport-util-concurrent dependency.

    1. The backport-util-concurrent artifact isn't OSGi-fied, however there are some other artifacts available that add OSGi metadata:

    http://search.maven.org/#artifactdetails%7Corg.apache.geronimo.bundles%7Cbackport-util-concurrent%7C2.2_1%7Cbundle

    http://repo1.maven.org/maven/mule/dependencies/maven2/backport-util-concurrent/backport-util-concurrent/3.1-osgi/

    1. As the backport-util-concurrent implementation references the "sun.misc" package, the OSGi environment must provide this package for import. For example, in Felix I think you might add something like this to the configuration:

      org.osgi.framework.system.packages.extra=sun.misc

    As a result of these limitations I have made the backport-util-concurrent dependency optional in order to be able to use ical4j as an OSGi bundle without this dependency. Note however that some parts of ical4j do require this dependency, so it may not fully work.

    This issue will be resolved in ical4j 2.x where the backport-util-concurrent dependency is no longer used.

    regards,
    ben