I want to make the following solution: Apache Felix + Weld for Java SE. To do this, I want to run one of the examples from the welding archive - welding-osgi-paint. At the moment, I have the following list of buns:
cdi-api.jar
ops4j-base-lang-1.5.0.jar
pax-swissbox-core-1.8.0.jar
weld-osgi-paint-core.jar
org.apache.felix.scr-1.8.2.jar
pax-swissbox-lifecycle-1.8.0.jar
weld-osgi-paint-square.jar
javax.annotation-api-1.2.jar
org.apache.servicemix.bundles.javax-inject-1_2.jar
pax-swissbox-tracker-1.8.0.jar
weld-osgi-paint-triangle.jar
javax.el-api-2.2.4.jar
pax-cdi-api-0.11.0.jar
slf4j-api-1.7.6.jar
xbean-bundleutils-4.1.jar
javax.interceptor-api-1.2.jar
pax-cdi-extension-0.11.0.jar
slf4j-log4j12-1.7.2.jar
log4j-1.2.17.jar
pax-cdi-spi-0.11.0.jar
weld-osgi-paint-api.jar
org.osgi.compendium-4.3.1.jar
org.osgi.core-4.3.1.jar
And I get the following:
org.osgi.framework.BundleException: constraint constraint is used. Fails to allow revision of the org.ops4j.pax.cdi.extension [9.0] package because it is subjected to the "org.osgi.framework" package from the package versions of org.apache.felix.framework [0] and osgi.core [2.0 ] through two network dependencies.
1: org.ops4j.pax.cdi.extension [9.0] import: (& (osgi.wiring.package = org.osgi.framework) ( >= 1.7.0) (! ( >= 2.0.0))) | export: osgi.wiring.package = org.osgi.framework org.apache.felix.framework [0]
2: org.ops4j.pax.cdi.extension [9.0] import: (& (osgi.wiring.package = org.osgi.util.tracker) ( >= 1.5.0) (! ( >= 2.0.0))) | export: osgi.wiring.package = org.osgi.util.tracker; : = org.osgi.framework osgi.cmpn [3.0] import: (osgi.wiring.package = org.osgi.framework) | export: osgi.wiring.package = org.osgi.framework osgi.core [2.0]
... Caused by: java.lang.ClassCastException: org.apache.felix.scr.impl.Activator org.osgi.framework.BundleActivator at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4177)
, , , pax cdi org.osgi, apache felix. ?
1
Whem org.osgi.core , org.osgi.service.packageadmin org.osgi.core.
org.osgi.framework.BundleException: org.ops4j.pax.cdi.extension [8]: 8.0: [8.0] osgi.wiring.package; (& ;! (Osgi.wiring.package = org.ops4j.pax.cdi.spi) ( >= 0.11.0) (( >= 1.0.0))) [: 9.0: [9.0] osgi.wiring.package; (& ;! (Osgi.wiring.package = org.apache.xbean.osgi.bundle.util) ( >= 3.18.0) (( >= 5.0.0))) [: 16.0: [16.0] osgi.wiring.package; (& ;! (Osgi.wiring.package = org.osgi.service.packageadmin) ( >= 1.2.0) (( >= 2.0.0)))]] org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826) at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931) com.techsenger.launcher.core.se.all.Launcher.startBundles(Launcher.java:146) com.techsenger.launcher.core.se.all.Launcher.main(Launcher.java:60)
2
, org.apache.felix.framework-4.0.3.jar. , org.osgi.core, . :
String SYSTEM_PACKAGES =
"org.osgi.framework;version=\"1.8\"," +
"org.osgi.service.packageadmin;version=\"1.8\","+
"org.osgi.framework.wiring;version=\"1.8\","+
"javax.swing,javax.management,javax.naming,javax.xml.parsers,"+
"org.w3c.dom,org.xml.sax,org.xml.sax.helpers";
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES, SYSTEM_PACKAGES);
, 0.8.0 pax-cdi- * . :
org.osgi.framework.BundleException: org.jboss.weld.examples.weld-osgi-paint-core [23]: 23.0: [23.0] osgi.extender; (osgi.extender = pax.cdi) org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826) at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
? , .