You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2013/09/25 08:02:18 UTC

Unresolved constraint in bundle core

I am new to osgi, and trying to prototype a modular system.

The modules are built with maven, and using maven-bundle-plugin.

The base module is using apache commons configurations package:

<plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven-bundle-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>

<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>

<Bundle-Activator>org.marmagate.system.Activator</Bundle-Activator>
                        <Export-Package>
                            org.marmagate.system; version=${project.version}
                        </Export-Package>
                        <Import-Package>
                            !com.ibm.uvm.tools,
                            !com.sun.jdmk.comm,
                            !javax.jmdns,
                            !javax.jms,
                            !oracle.xml.parser*,
                            !org.apache.commons.jexl2,
                            !org.apache.commons.vfs2*,
                            !org.apache.log,
                            !org.apache.xerces.*,
                            !org.jaxen*,
                            !org.apache.xml.resolver*,
                            !sun.security.util,
                            org.apache.commons.configuration,
                            *
                        </Import-Package>
                        <Embed-Dependency>
                            *
                        </Embed-Dependency>
                        <Embed-Directory>lib</Embed-Directory>
                        <Embed-Transitive>true</Embed-Transitive>
                    </instructions>
                </configuration>
            </plugin>

In the dependencies section, I have:

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>com.springsource.org.apache.commons.configuration</artifactId>
            <version>1.8.0</version>
        </dependency>

When I deploy and start this module I get:

......
Caused by: org.osgi.framework.BundleException: Unresolved constraint
in bundle core [128]: Unable to resolve 128.0: missing requirement
[128.0] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.commons.configuration)(version>=1.8.0)(!(version>=2.0.0)))
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
......


I had to manually add "org.apache.commons.configuration," to
<Import-Package> because it's not automatically added by
maven-bundle-plugin. This part is from MANIFEST.MF for
commons.configuration :

Export-Package: org.apache.commons.configuration;version="1.8.0";uses:
 ="javax.naming,javax.sql,javax.xml.parsers,javax.xml.transform,org.ap
 ache.commons.collections,org.apache.commons.configuration.beanutils,o
 rg.apache.commons.configuration.event,org.apache.commons.configuratio
 n.interpol,org.apache.commons.configuration.reloading,org.apache.comm
 ons.configuration.resolver,org.apache.commons.configuration.tree,org.
 apache.commons.digester,org.apache.commons.lang.exception,org.apache.
 commons.lang.text,org.apache.commons.logging,org.apache.commons.vfs2,
 org.w3c.dom,org.xml.sax,org.xml.sax.helpers",org.apache.commons.confi
 guration.beanutils;version="1.8.0";uses:="org.apache.commons.beanutil
 s,org.apache.commons.configuration,org.apache.commons.configuration.t
 ree",org.apache.commons.configuration.event;version="1.8.0",org.apach
 e.commons.configuration.interpol;version="1.8.0";uses:="org.apache.co
 mmons.configuration,org.apache.commons.lang.text",org.apache.commons.
 configuration.plist;version="1.8.0";uses:="org.apache.commons.configu
 ration,org.xml.sax,org.xml.sax.helpers",org.apache.commons.configurat
 ion.reloading;version="1.8.0";uses:="org.apache.commons.configuration
 ,org.apache.commons.vfs2",org.apache.commons.configuration.resolver;v
 ersion="1.8.0";uses:="org.apache.commons.configuration,org.apache.com
 mons.lang.text,org.apache.commons.logging,org.apache.xml.resolver,org
 .apache.xml.resolver.tools,org.xml.sax",org.apache.commons.configurat
 ion.tree;version="1.8.0",org.apache.commons.configuration.tree.xpath;
 version="1.8.0";uses:="org.apache.commons.configuration.tree,org.apac
 he.commons.jxpath,org.apache.commons.jxpath.ri,org.apache.commons.jxp
 ath.ri.compiler,org.apache.commons.jxpath.ri.model",org.apache.common
 s.configuration.web;version="1.8.0";uses:="javax.servlet,org.apache.c
 ommons.configuration"
Unversioned-Imports: javax.naming.*,javax.sql.*,javax.xml.parsers.*,ja
 vax.xml.transform.*,org.w3c.dom.*,org.xml.sax.*



All the declared dependencies are copied to /lib folder in the target
bundle "core-1.0.jar".


What else I can do to troubleshoot this issue and resolve it ??