[ 
https://issues.apache.org/jira/browse/FELIX-2116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836559#action_12836559
 ] 

Charles Moulliard commented on FELIX-2116:
------------------------------------------

@Richard,

You are right. The DynamicImport statement is not used at all during the 
dependency resolution by Felix and the issue is related to the fact that Karaf 
exports all the JRE packages with
version = '0.0.0'. 

In the example that I report here, the client uses the '*' in the 
Import-Package instruction to add automatically the packages. The plugin/bnd 
tool discovers maven transversal dependencies
and add them as I mention with a version number. To solve this problem, I 
propose to the user to check which packages must be imported and add them 
manually. If he prefers to continue 
to work with '*' instruction, then he must parameter it like that : 
*;resolution:=optional

> JRE packages & org.osgi.framework.BundleException: Unresolved constraint
> ------------------------------------------------------------------------
>
>                 Key: FELIX-2116
>                 URL: https://issues.apache.org/jira/browse/FELIX-2116
>             Project: Felix
>          Issue Type: Bug
>          Components: Karaf
>    Affects Versions: karaf-1.2.0
>            Reporter: Charles Moulliard
>
> Here is more details about the unresolved constraint
> Here is what the bundle import :
> ka...@root> headers 117
> MAESTRO :: SOA Fw :: WebServices (117)
> --------------------------------------
> Bnd-LastModified = 1266589733099
> Build-Jdk = 1.6.0_16
> Built-By = T0106319
> Bundle-ManifestVersion = 2
> Bundle-Name = MAESTRO :: SOA Fw :: WebServices
> Bundle-SymbolicName = maestro_SOAFw_WebServices
> Bundle-Version = 0.4.0.migr-42-SNAPSHOT
> Created-By = Apache Maven Bundle Plugin
> DynamicImport-Package = javax.*,org.w3c.*,org.xml.*
> Export-Package = 
> com.thalesgroup.maestro.wsdl.system.xsd;uses:="javax.xml.bind.annotation,javax.xml.datatype",com.thalesgroup.maestro.wsdl.event;uses:="javax.jws.soap,javax.jws,javax.xml.bind.annotation,com.thalesgroup.maestro.wsdl.event.xsd,javax.xml.ws,javax.xml.namespace",com.thalesgroup.maestro.wsdl.sop.xsd;uses:="javax.xml.bind.annotation,javax.xml.datatype",wsdl,com.thalesgroup.maestro.wsdl.status.xsd;uses:="javax.xml.bind.annotation,javax.xml.datatype",com.thalesgroup.maestro.wsdl.alarm.x
> sd;uses:="javax.xml.bind.annotation,javax.xml.datatype",com.thalesgroup.maestro.wsdl.alarm;uses:="javax.jws.soap,javax.jws,com.thalesgroup.maestro.wsdl.alarm.xsd,javax.xml.bind.annotation,javax.xml.ws,javax.xml.namespace",com.thalesgroup.maestro.wsdl.event.xsd;uses:="javax.xml.bind.annotation,javax.xml.datatype",com.thalesgroup.maestro.wsdl.system;uses:="javax.jws.soap,com.thalesgroup.maestro.wsdl.system.xsd,javax.jws,javax.xml.bind.annotation,javax.xml.ws,javax.xml.namespace",com.thalesgroup.ma
> estro.wsdl.command.xsd;uses:="javax.xml.bind.annotation,javax.xml.datatype",com.thalesgroup.maestro.wsdl.status;uses:="javax.jws.soap,javax.jws,com.thalesgroup.maestro.wsdl.status.xsd,javax.xml.bind.annotation,javax.xml.ws,javax.xml.namespace",com.thalesgroup.maestro.wsdl.command;uses:="javax.jws.soap,javax.jws,javax.xml.bind.annotation,javax.xml.ws,javax.xml.namespace,com.thalesgroup.maestro.wsdl.command.xsd",com.thalesgroup.maestro.wsdl.sop;uses:="javax.jws.soap,com.thalesgroup.maestro.wsdl.so
> p.xsd,javax.jws,javax.xml.bind.annotation,javax.xml.ws,javax.xml.namespace"
> Import-Package = 
> com.thalesgroup.maestro.wsdl.alarm,com.thalesgroup.maestro.wsdl.alarm.xsd,com.thalesgroup.maestro.wsdl.command,com.thalesgroup.maestro.wsdl.command.xsd,com.thalesgroup.maestro.wsdl.event,com.thalesgroup.maestro.wsdl.event.xsd,com.thalesgroup.maestro.wsdl.sop,com.thalesgroup.maestro.wsdl.sop.xsd,com.thalesgroup.maestro.wsdl.status,com.thalesgroup.maestro.wsdl.status.xsd,com.thalesgroup.maestro.wsdl.system,com.thalesgroup.maestro.wsdl.system.xsd,javax.jws;version="2.0",javax.jws.s
> oap;version="2.0",javax.xml.bind.annotation;version="2.1",javax.xml.datatype;version="1.4",javax.xml.namespace;version="1.4",javax.xml.ws;version="2.1",wsdl
> Manifest-Version = 1.0
> Tool = Bnd-0.0.238
> ka...@root>
> So we see that the bundle import the following package : 
> javax.xml.datatype;version="1.4" and that 
> DynamicImport-Package = javax.*,org.w3c.*,org.xml.* has been defined
> And the error generated :
> DEBUG: DYNAMIC WIRE: 114.0 -> org.apache.camel.spi -> 44.0
> DEBUG: META-INF/services/javax.xml.parsers.DocumentBuilderFactory
> DEBUG: META-INF/services/javax.xml.parsers.DocumentBuilderFactory
> ERROR: Error starting 
> file:/D:/Dev/apache-servicemix-4.2.0-fuse-01-00/deploy/maestro-webservices-0.4.0-migr-4.2-SNAPSHOT.jar
>  (org.osgi.framework.BundleException: Unresolved constraint in bundle 
> maestro_SOAFw_WebServices [117]: package; 
> (&(package=javax.xml.datatype)(version>=1.4.0)))
> org.osgi.framework.BundleException: Unresolved constraint in bundle 
> maestro_SOAFw_WebServices [117]: package; 
> (&(package=javax.xml.datatype)(version>=1.4.0))
> DEBUG: DYNAMIC WIRE: 114.0 -> com.sun.org.apache.xerces.internal.jaxp -> 0
> DEBUG: DYNAMIC WIRE: 114.0 -> org.xml.sax -> 0  at 
> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3263)
>         at org.apache.felix.framework.Felix.startBundle(Felix.java:1597)
>         at 
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1077)
>         at 
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>         at java.lang.Thread.run(Thread.java:619)
> If we check what is exported by the bundle 0 (=jre) of Felix, we see that 
> datatype is exported :
> System Bundle (0): javax.xml.datatype; version=0.0.0
> Can someone tell me what is wrong ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to