Karaf 4.4.3 from a fresh install
Aries CDI 1.1.5
I am early in the process of getting an OpenWebBeans implementation of CDI
working with war bundle. Currently the feature osgi-cdi-owb is failing to
install because of the error below:
Uses constraint violation. Unable to resolve resource
org.apache.aries.cdi.extension.servlet.owb
[org.apache.aries.cdi.extension.servlet.owb [109](R 109.0)]
because it is exposed to package 'javax.annotation' from resources
org.apache.servicemix.specs.annotation-api-1.3
[org.apache.servicemix.specs.annotation-api-1.3 [97](R 97.0)]
and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via two
dependency chains.
What is curious is that javax.annotation is v1.3.5 is replaced by version 1.3.0
during the installation of feature osgi-cdi-owb even though v1.3.0 already
exist in bundle #0 from org.apache.felix.framework.
What am I doing wrong?
***
* Commands to recreate
***
bin/karaf clean
feature:install pax-web-http
feature:install pax-web-war
feature:install pax-web-jsp
feature:repo-add mvn:org.apache.aries.cdi/aries-cdi-feature/1.1.5/xml/features
shell:echo "Before installing osgi-cdi-owb"
package:exports | grep javax.annotation
bundle:list -s -t 0 | grep annotation
bundle:headers 73
feature:install osgi-cdi-owb
shell:echo "After installing osgi-cdi-owb"
package:exports | grep javax.annotation
bundle:list -s -t 0 | grep annotation
bundle:headers 97
feature:install osgi-cdi-owb-web
bundle:install --start
mvn:org.apache.aries.cdi/org.apache.aries.cdi.extension.servlet.common/1.1.5
bundle:install --start
mvn:org.apache.aries.cdi/org.apache.aries.cdi.extension.servlet.owb/1.1.5
***
* Log of activity
***
paul@hummingbird apache-karaf-4.4.3 % bin/karaf clean
__ __ ____ / //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (4.4.3)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
karaf@root()> feature:install pax-web-http
> feature:install pax-web-war
> feature:install pax-web-jsp
> feature:repo-add mvn:org.apache.aries.cdi/aries-cdi-feature/1.1.5/xml/features
> shell:echo "Before installing osgi-cdi-owb"
> package:exports | grep javax.annotation
> bundle:list -s -t 0 | grep annotation > bundle:headers 73
> feature:install osgi-cdi-owb
> shell:echo "After installing osgi-cdi-owb"
> package:exports | grep javax.annotation
> bundle:list -s -t 0 | grep annotation > bundle:headers 97
> feature:install osgi-cdi-owb-web
> bundle:install --start
> mvn:org.apache.aries.cdi/org.apache.aries.cdi.extension.servlet.common/1.1.5
> bundle:install --start
> mvn:org.apache.aries.cdi/org.apache.aries.cdi.extension.servlet.owb/1.1.5
> Adding feature url
> mvn:org.apache.aries.cdi/aries-cdi-feature/1.1.5/xml/features
Before installing osgi-cdi-owb
javax.annotation.processing │ 1.0.0 │ 0 │
org.apache.felix.framework
javax.annotation.security │ 1.3.5 │ 73 │
jakarta.annotation-api
javax.annotation.sql │ 1.3.5 │ 73 │
jakarta.annotation-api
javax.annotation │ 1.3.0 │ 0 │
org.apache.felix.framework
javax.annotation │ 1.3.5 │ 73 │
jakarta.annotation-api
73 │ Active │ 30 │ 1.3.5 │ jakarta.annotation-api
Jakarta Annotations API (73)
----------------------------
Automatic-Module-Name = java.annotation
Bnd-LastModified = 1564744140223
Build-Jdk = 1.8.0_202
Built-By = default
Created-By = Apache Maven Bundle Plugin
Extension-Name = jakarta.annotation
Implementation-Vendor = Eclipse Foundation
Implementation-Vendor-Id = org.glassfish
Implementation-Version = 1.3.5
Manifest-Version = 1.0
Specification-Vendor = Eclipse Foundation
Specification-Version = 1.3
Tool = Bnd-4.2.0.201903051501
Bundle-Description = Jakarta Annotations API
Bundle-DocURL = https://www.eclipse.org
Bundle-License = http://www.eclipse.org/legal/epl-2.0,
https://www.gnu.org/software/classpath/license.html
Bundle-ManifestVersion = 2
Bundle-Name = Jakarta Annotations API
Bundle-SymbolicName = jakarta.annotation-api
Bundle-Vendor = Eclipse Foundation
Bundle-Version = 1.3.5
Require-Capability = osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.8))
Export-Package = javax.annotation.security;version=1.3.5,
javax.annotation.sql;version=1.3.5,
javax.annotation;version=1.3.5
After installing osgi-cdi-owb
javax.annotation.processing │ 1.0.0 │ 0 │
org.apache.felix.framework
javax.annotation.security │ 1.3.0 │ 97 │
org.apache.servicemix.specs.annotation-api-1.3
javax.annotation.sql │ 1.3.0 │ 97 │
org.apache.servicemix.specs.annotation-api-1.3
javax.annotation │ 1.3.0 │ 0 │
org.apache.felix.framework
javax.annotation │ 1.3.0 │ 97 │
org.apache.servicemix.specs.annotation-api-1.3
97 │ Active │ 80 │ 1.3.0.3 │
org.apache.servicemix.specs.annotation-api-1.3
Apache ServiceMix :: Specs :: Annotation API 1.3 (97)
-----------------------------------------------------
Bnd-LastModified = 1584974695696
Build-Jdk = 1.8.0_172
Built-By = jbonofre
Created-By = Apache Maven Bundle Plugin
Implementation-Title = Apache ServiceMix
Implementation-Version = 1.3_3
Manifest-Version = 1.0
Tool = Bnd-3.4.0.201707252008
Bundle-Description = This pom provides project information that is common to
all ServiceMix branches.
Bundle-DocURL = http://www.apache.org/
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2
Bundle-Name = Apache ServiceMix :: Specs :: Annotation API 1.3
Bundle-SymbolicName = org.apache.servicemix.specs.annotation-api-1.3
Bundle-Vendor = The Apache Software Foundation
Bundle-Version = 1.3.0.3
Provide-Capability = osgi.contract;
uses:="javax.annotation.sql,
javax.annotation,
javax.annotation.security";
osgi.contract=JavaAnnotation;
version:List<Version>="1.3,1.2,1.1,1"
Require-Capability = osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.8))
Export-Package = javax.annotation;version=1.3,
javax.annotation.security;version=1.3,
javax.annotation.sql;version=1.3
Bundle ID: 108
Bundle ID: 109
Error executing command: Error installing bundles:
Unable to start bundle
mvn:org.apache.aries.cdi/org.apache.aries.cdi.extension.servlet.owb/1.1.5:
org.osgi.framework.BundleException: Uses constraint violation. Unable to
resolve resource org.apache.aries.cdi.extension.servlet.owb
[org.apache.aries.cdi.extension.servlet.owb [109](R 109.0)] because it is
exposed to package 'javax.annotation' from resources
org.apache.servicemix.specs.annotation-api-1.3
[org.apache.servicemix.specs.annotation-api-1.3 [97](R 97.0)] and
org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via two
dependency chains.
Chain 1:
org.apache.aries.cdi.extension.servlet.owb
[org.apache.aries.cdi.extension.servlet.owb [109](R 109.0)]
import: (osgi.wiring.package=javax.annotation)
|
export: osgi.wiring.package: javax.annotation
org.apache.servicemix.specs.annotation-api-1.3
[org.apache.servicemix.specs.annotation-api-1.3 [97](R 97.0)]
Chain 2:
org.apache.aries.cdi.extension.servlet.owb
[org.apache.aries.cdi.extension.servlet.owb [109](R 109.0)]
import:
(&(osgi.wiring.package=org.apache.webbeans.config)(version>=2.0.0)(!(version>=3.0.0)))
|
export: osgi.wiring.package=org.apache.webbeans.config;
uses:=javax.annotation
openwebbeans-impl [openwebbeans-impl [86](R 86.0)]
import:
(&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
|
export: osgi.wiring.package: javax.annotation
org.apache.felix.framework [org.apache.felix.framework [0](R 0)] Unresolved
requirements: [[org.apache.aries.cdi.extension.servlet.owb [109](R 109.0)]
osgi.wiring.package;
(&(osgi.wiring.package=org.apache.webbeans.config)(version>=2.0.0)(!(version>=3.0.0)))]
karaf@root()>
Paul Spencer