Embedding xbean-spring bundle into activemq-osgi solves the problem with Camel 2.17.x and 2.18.x. I have created an Issue in ActiveQM (AMQ-6576) and a pull request with the fix. Hope it will solve the problem (and make no new problems :-) ). I have tested the modified ActiveQM with ServiceMix (manually and itests) as well as a smoke test to be sure this change didn't make any new errors.
Kindly regards Krzysztof On 24.01.2017 00:48, Krzysztof Sobkowiak wrote: > Hi > > I have performed some analysis for 2.17.5 (for 2.18.x problem looks more > complicated) > > karaf@root()> feature:repo-add camel 2.17.5 > Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.17.5/xml/features > karaf@root()> feature:repo-add activemq 5.14.3 > Adding feature url mvn:org.apache.activemq/activemq-karaf/5.14.3/xml/features > > And now: > > karaf@root()> feature:install -v activemq-camel > Adding features: activemq-camel/[5.14.3,5.14.3] > Changes to perform: > Region: root > Bundles to install: > ..... > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-beans/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-beans/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context-support/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context-support/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-expression/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-expression/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-jms/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-jms/4.2.8.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-tx/3.2.17.RELEASE_1 > > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-tx/4.2.8.RELEASE_1 > > 2 versions of Spring are installed. > > Now: > > karaf@root()> list -t 0 > START LEVEL 100 , List Threshold: 0 > ID | State | Lvl | Version | Name > ------------------------------------------------------------------------------------------------------------ > .... > 69 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-aop > 70 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-aop > 71 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-beans > 72 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-beans > 73 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-context > 74 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-context > 75 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-context-support > 76 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-context-support > 77 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-core > 78 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-core > 79 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-expression > 80 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-expression > 81 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-jms > 82 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-jms > 83 | Active | 30 | 3.2.17.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-tx > 84 | Active | 30 | 4.2.8.RELEASE_1 | Apache ServiceMix :: Bundles :: > spring-tx > > And when you examine the dependency tree of activemq-camel you can see > following (excuse me long listings): > > karaf@root()> bundle:tree-show 52 > Bundle org.apache.activemq.activemq-camel [52] is currently ACTIVE > > org.apache.activemq.activemq-camel [52] > +- org.apache.servicemix.bundles.spring-core [77] > | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.karaf.services.eventadmin [6] > | +- org.apache.felix.configadmin [3] > | +- org.apache.felix.metatype [5] > +- org.apache.servicemix.bundles.spring-jms [81] > | +- org.apache.servicemix.bundles.spring-core [77] > | +- org.apache.servicemix.bundles.spring-beans [71] > | | +- org.apache.servicemix.bundles.spring-core [77] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.spring-aop [69] > | | +- org.apache.servicemix.bundles.spring-core [77] > | | +- org.apache.servicemix.bundles.spring-beans [71] > | | +- org.apache.servicemix.bundles.aopalliance [67] > | | +- org.apache.commons.pool [61] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.spring-context [73] > | | +- org.apache.servicemix.bundles.spring-expression [79] > | | | +- org.apache.servicemix.bundles.spring-core [77] > | | +- org.apache.servicemix.bundles.spring-core [77] > | | +- org.apache.servicemix.bundles.spring-aop [69] > | | +- org.apache.servicemix.bundles.spring-beans [71] > | | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | | | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [65] > | | +- org.apache.servicemix.bundles.aopalliance [67] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | +- org.apache.servicemix.bundles.spring-tx [83] > | | +- org.apache.servicemix.bundles.spring-core [77] > | | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [65] > | | +- org.apache.servicemix.bundles.spring-beans [71] > | | +- org.apache.servicemix.bundles.spring-aop [69] > | | +- org.apache.servicemix.bundles.spring-context [73] > | | +- org.apache.servicemix.bundles.aopalliance [67] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.aopalliance [67] > | +- org.ops4j.pax.logging.pax-logging-api [1] > +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > +- org.apache.servicemix.bundles.spring-tx [83] > +- org.apache.activemq.activemq-osgi [53] > | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [65] > | +- org.apache.commons.net [60] > | +- org.apache.aries.blueprint.api [10] > | +- org.apache.servicemix.bundles.spring-beans [71] > | +- org.apache.hadoop.zookeeper [66] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.jvnet.jaxb2_commons.jaxb2-basics-runtime [86] > | | +- org.apache.servicemix.bundles.jaxb-impl [68] > | +- org.apache.aries.blueprint.core [12] > | | +- org.apache.aries.proxy.api [19] > | | | +- org.apache.aries.util [21] > | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.apache.aries.blueprint.api [10] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.apache.aries.util [21] > | | +- org.apache.karaf.services.eventadmin [6] > | +- org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec [63] > | +- org.apache.camel.camel-jms [58] > | | +- org.apache.servicemix.bundles.spring-jms [81] > | | +- org.apache.servicemix.bundles.spring-core [77] > | | +- org.apache.servicemix.bundles.spring-beans [71] > | | +- org.apache.servicemix.bundles.spring-context [73] > | | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | | +- org.apache.servicemix.bundles.spring-tx [83] > | | +- org.apache.camel.camel-core [57] > | | | +- org.apache.servicemix.bundles.spring-tx [84] > | | | | +- org.apache.servicemix.bundles.spring-aop [70] > | | | | | +- org.apache.commons.pool2 [62] > | | | | | +- org.apache.servicemix.bundles.aopalliance [67] > | | | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | | | +- org.apache.servicemix.bundles.spring-beans [72] > | | | | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | | | +- org.apache.commons.pool [61] > | | | | +- org.apache.servicemix.bundles.spring-context [74] > | | | | | +- org.apache.servicemix.bundles.spring-aop [70] > | | | | | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | | | | | +- org.apache.servicemix.bundles.spring-expression [80] > | | | | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | | | +- org.apache.servicemix.bundles.aopalliance [67] > | | | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | | | +- org.apache.servicemix.bundles.spring-beans [72] > | | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | | +- org.apache.servicemix.bundles.aopalliance [67] > | | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | | +- org.apache.servicemix.bundles.spring-beans [72] > | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.spring-core [77] > | +- org.apache.servicemix.bundles.spring-jms [81] > | +- org.apache.servicemix.bundles.spring-aop [69] > | +- org.apache.felix.configadmin [3] > | +- org.apache.servicemix.bundles.spring-context [73] > | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | +- org.apache.servicemix.bundles.spring-tx [83] > | +- org.apache.commons.pool2 [62] > | +- org.objectweb.asm.all [50] > | +- org.apache.servicemix.bundles.aopalliance [67] > | +- org.apache.camel.camel-core [57] > | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.xbean.spring [85] > | +- org.apache.servicemix.bundles.spring-core [77] > | +- org.apache.servicemix.bundles.spring-beans [71] > | +- org.apache.servicemix.bundles.spring-context [73] > | +- org.ops4j.pax.logging.pax-logging-api [1] > +- org.apache.camel.camel-core [57] > +- org.ops4j.pax.logging.pax-logging-api [1] > +- org.apache.camel.camel-jms [58] > > > As you can see, almost everywhere the version 3.2.17.RELEASE_1 of Spring > bundles are wired, but camel-core wires the Spring 4.2.8.RELEASE_1 > > Of course, after restart well known exception > > Caused by: java.lang.ClassNotFoundException: > org.apache.xbean.spring.context.v2.XBeanNamespaceHandler not found by > org.apache.activemq.activemq-osgi [53] > > Let's inspect again. > > karaf@root()> bundle:tree-show 52 > Bundle org.apache.activemq.activemq-camel [52] is currently ACTIVE > > org.apache.activemq.activemq-camel [52] > +- org.apache.servicemix.bundles.spring-tx [84] > | +- org.apache.servicemix.bundles.spring-aop [70] > | | +- org.apache.commons.pool2 [62] > | | +- org.apache.commons.pool [61] > | | +- org.apache.servicemix.bundles.aopalliance [67] > | | +- org.apache.servicemix.bundles.spring-beans [72] > | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | | | +- org.apache.karaf.services.eventadmin [6] > | | | | +- org.apache.felix.metatype [5] > | | | | +- org.apache.felix.configadmin [3] > | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.apache.servicemix.bundles.spring-core [78] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.spring-context [74] > | | +- org.apache.servicemix.bundles.spring-expression [80] > | | | +- org.apache.servicemix.bundles.spring-core [78] > | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.apache.servicemix.bundles.spring-aop [70] > | | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | | | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [65] > | | +- org.apache.servicemix.bundles.aopalliance [67] > | | +- org.apache.servicemix.bundles.spring-beans [72] > | | +- org.apache.servicemix.bundles.spring-core [78] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.aopalliance [67] > | +- org.apache.servicemix.bundles.spring-beans [72] > | +- org.apache.servicemix.bundles.spring-core [78] > | +- org.ops4j.pax.logging.pax-logging-api [1] > +- org.apache.activemq.activemq-osgi [53] > | +- org.apache.commons.pool2 [62] > | +- org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec [63] > | +- org.apache.felix.configadmin [3] > | +- org.apache.hadoop.zookeeper [66] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.aries.blueprint.core [12] > | | +- org.apache.karaf.services.eventadmin [6] > | | +- org.apache.aries.blueprint.api [10] > | | +- org.apache.aries.proxy.api [19] > | | | +- org.apache.aries.util [21] > | | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | | +- org.apache.aries.util [21] > | +- org.apache.commons.net [60] > | +- org.apache.servicemix.bundles.spring-context [74] > | +- org.apache.camel.camel-core [57] > | | +- org.apache.servicemix.bundles.spring-tx [84] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.apache.servicemix.bundles.spring-core [78] > | +- org.apache.servicemix.bundles.spring-tx [84] > | +- org.apache.servicemix.bundles.spring-aop [70] > | +- org.apache.servicemix.bundles.spring-jms [82] > | | +- org.apache.servicemix.bundles.spring-expression [80] > | | +- org.apache.servicemix.bundles.spring-tx [84] > | | +- org.apache.servicemix.bundles.spring-aop [70] > | | +- org.apache.servicemix.bundles.spring-context [74] > | | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | | +- org.apache.servicemix.bundles.aopalliance [67] > | | +- org.apache.servicemix.bundles.spring-beans [72] > | | +- org.apache.servicemix.bundles.spring-core [78] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.jvnet.jaxb2_commons.jaxb2-basics-runtime [86] > | | +- org.apache.servicemix.bundles.jaxb-impl [68] > | +- org.apache.aries.blueprint.api [10] > | +- org.objectweb.asm.all [50] > | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | +- org.apache.servicemix.bundles.aopalliance [67] > | +- org.apache.servicemix.bundles.spring-beans [72] > | +- org.apache.geronimo.specs.geronimo-jta_1.1_spec [65] > | +- org.apache.camel.camel-jms [58] > | | +- org.apache.servicemix.bundles.spring-tx [84] > | | +- org.apache.servicemix.bundles.spring-jms [82] > | | +- org.apache.servicemix.bundles.spring-context [74] > | | +- org.apache.camel.camel-core [57] > | | +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > | | +- org.apache.servicemix.bundles.spring-beans [72] > | | +- org.apache.servicemix.bundles.spring-core [78] > | | +- org.ops4j.pax.logging.pax-logging-api [1] > | +- org.ops4j.pax.logging.pax-logging-api [1] > +- org.apache.servicemix.bundles.spring-jms [82] > +- org.apache.camel.camel-core [57] > +- org.apache.geronimo.specs.geronimo-jms_1.1_spec [64] > +- org.apache.servicemix.bundles.spring-core [78] > +- org.apache.camel.camel-jms [58] > +- org.ops4j.pax.logging.pax-logging-api [1] > > Now all bundles are re-wired and you can see all bundles use the Spring > 4.2.8.RELEASE_1, but there is no org.apache.xbean.spring in this dependency > tree. Probably because of the error while restarting Karaf. When we inspect > this bundle we can see it doesn't allow to wire the Spring 4. > > org.springframework.beans;version="[2.5,4)", > org.springframework.beans.factory;version="[2.5,4)", > org.springframework.beans.factory.config;version="[2.5,4)", > org.springframework.beans.factory.parsing;version="[2.5,4)", > org.springframework.beans.factory.support;version="[2.5,4)", > org.springframework.beans.factory.xml;version="[2.5,4)", > org.springframework.context;version="[2.5,4)", > org.springframework.context.support;version="[2.5,4)", > org.springframework.core.io;version="[2.5,4)", > org.springframework.core.io.support;version="[2.5,4)", > org.springframework.util;version="[2.5,4)", > org.springframework.util.xml;version="[2.5,4)", > > So we have one bundle which cannot use the same Spring version like all other > bundles. Maybe this is the problem. > > Kindly regards > Krzysztof > > > > On 19.01.2017 08:15, Sobkowiak Krzysztof wrote: >> Btw, this trick with camel-cxf doesn't help with Camel 2.18.x. I think, >> there was a change in Camel 2.17.3 which helped with this problem (but not >> completely yet), but the change is not available in 2.18.x (I tried current >> snapshot and it didn't help too). >> >> It looks like this change has helped in 2.17.3 >> https://github.com/apache/camel/commit/284cc6780de1e32468ef2ae50ad357a444e79da1 >> (CAMEL-10153), which introduces [3.2,5) as version range for spring in >> camel-cxf. In 2.18.x there is still used the version range [4.1,5) >> >> Regards >> Krzysztof >> >> On 19.01.2017 01:17, Krzysztof Sobkowiak wrote: >>> My mistake. This problem still happens in the sample steps below - the >>> exception still occurs after Karaf restart and broker doesn't start. >>> But adding camel-cxf seems to fix this problem >>> >>> feature:install camel camel-blueprint camel-jms camel-cxf activemq-camel >>> activemq-broker-noweb activemq-blueprint >>> >>> Kindly regards >>> Krzysztof >>> >>> >>> On 14.01.2017 22:55, Krzysztof Sobkowiak wrote: >>>> Hi >>>> >>>> I could successfully install Camel 2.17.3 and ActiveMQ 5.14.3 on Karaf >>>> 4.0.8 (also 4.0.7): >>>> >>>> >>>> __ __ ____ >>>> / //_/____ __________ _/ __/ >>>> / ,< / __ `/ ___/ __ `/ /_ >>>> / /| |/ /_/ / / / /_/ / __/ >>>> /_/ |_|\__,_/_/ \__,_/_/ >>>> >>>> Apache Karaf (4.0.8) >>>> >>>> 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:repo-add camel 2.17.3 >>>> Adding feature url >>>> mvn:org.apache.camel.karaf/apache-camel/2.17.3/xml/features >>>> karaf@root()> feature:repo-add activemq 5.14.3 >>>> Adding feature url >>>> mvn:org.apache.activemq/activemq-karaf/5.14.3/xml/features >>>> karaf@root()> feature:install camel camel-blueprint camel-jms >>>> activemq-camel activemq-broker-noweb activemq-blueprint >>>> karaf@root()> activemq:list >>>> brokerName = amq-broker >>>> >>>> >>>> Kindly tegards >>>> Krzysztof >>>> >>>> On 30.11.2016 14:11, IODB wrote: >>>>> Can somebody refer me to the relevant Jira issue, so I can track its >>>>> progress? >>>>> >>>>> Thanks >>>>> >>>>> >> Krzysztof Sobkowiak >> >> JEE & OSS Architect, Integration Architect >> Apache Software Foundation Member (http://apache.org/) >> Apache ServiceMix Committer & PMC Member (http://servicemix.apache.org/) >> Senior Solution Architect @ Capgemini SSC (http://www.capgeminisoftware.pl/) > > -- Krzysztof Sobkowiak (@ksobkowiak) JEE & OSS Architect, Integration Architect Apache Software Foundation Member (http://apache.org/) Apache ServiceMix Committer & PMC Member (http://servicemix.apache.org/) Senior Solution Architect @ Capgemini SSC (http://www.capgeminisoftware.pl/)