Hello. I've tried your commands for ActveMQ client installation, and it seems to work fine. Thanks !!!
I've adapted a bit your commands and added 3 more commands to create my connection factory : # Installing ActiveMQ client and JMS features feature:repo-add mvn:org.apache.karaf.features/spring-legacy/4.4.1/xml/features feature:repo-add mvn:org.apache.activemq/activemq-karaf/5.16.5/xml/features feature:install activemq-client feature:install jms feature:install pax-jms-activemq # Creating a connection factory on external ActiveMQ broker jms:create -t activemq -u application -p secret --url tcp://localhost:61616 my_amq Now I have an exception when I deploy my applicative feature with Camel routes, using my own repository like that : repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features feature:install my-test-26-karaf-2-routes My feature that includes my own bundle and a dependency on another feature that pulls activemq-camel for my routes. They are defined with these repository files : <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes"> <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository> <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT"> <details>Fifi-T26 :: Camel routes - Configuration</details> <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile> </feature> <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT"> <details>Fifi-T26 :: Camel routes</details> <feature version="0.0.1-SNAPSHOT">my-test-26-karaf-x-feature</feature> <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature> <feature version="2.25.4">camel-csv</feature> <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle> <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle> </feature> </features> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf"> <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository> <repository>mvn:org.apache.activemq/activemq-karaf/5.16.5/xml/features</repository> <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT"> <details>Fifi-T26 :: Feature Definition</details> <feature version="0.0.1-SNAPSHOT">my-test-26-karaf-x-feature-activemq</feature> <feature version="2.25.4">camel-blueprint</feature> <feature version="2.25.4">camel-groovy</feature> <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle> <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle> </feature> <feature name="my-test-26-karaf-x-feature-activemq" version="0.0.1.SNAPSHOT"> <feature version="5.16.5">activemq-camel</feature> </feature> </features> And during the Camel context startup I have the following error, about missing class "org/apache/camel/component/jms/JmsBinding" 09:16:07.232 INFO [features-3-thread-1] Using custom UnitOfWorkFactory: my.test.t26.uow.service.SpecialUnitOfWorkFactory@94f8d8d 09:16:07.378 INFO [features-3-thread-1] Blueprint bundle my-test-26-karaf-2-routes/0.0.1.SNAPSHOT has been started 09:16:07.380 INFO [Blueprint Event Dispatcher: 1] Attempting to start CamelContext: K1-Test 09:16:07.384 INFO [Blueprint Event Dispatcher: 1] Apache Camel 2.25.4 (CamelContext: K1-Test) is starting 09:16:07.388 INFO [Blueprint Event Dispatcher: 1] StreamCaching is enabled on CamelContext: K1-Test 09:16:07.389 INFO [Blueprint Event Dispatcher: 1] MDC logging is enabled on CamelContext: K1-Test 09:16:07.391 INFO [Blueprint Event Dispatcher: 1] JMX is enabled 09:16:07.666 WARN [Blueprint Event Dispatcher: 1] Ignoring converter type: org.apache.activemq.camel.converter.ActiveMQMessageConverter as a dependent class could not be found: java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsBinding java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsBinding I don't understand what features are missing now. The package seems to be exported by a started bundle, with the matching Camel version : org.apache.camel.component.jms | 2.25.4 | 114 | org.apache.camel.camel-jms But when I look at the imports of this package, I see a strange thing : the bundle activemq-osgi seems to be installed twice now : org.apache.camel.component.jms | [2.20.0,4.0.0) | | 107 | org.apache.activemq.activemq-camel org.apache.camel.component.jms | [2.20.0,4.0.0) | resolved | 52 | org.apache.activemq.activemq-osgi org.apache.camel.component.jms | [2.25.0,3.0.0) | resolved | 108 | org.apache.activemq.activemq-osgi The duplicated bundles : 52 | Active | 80 | 5.16.5 | activemq-osgi 108 | Active | 80 | 5.16.1 | activemq-osgi And the feature activemq-camel that I try to install as a dependency from my feature can't resolve the JMS package 2.25.4 while it requires [2.20.0,4.0.0), just like one of the activemq-osgi [52]. I don't understand why : with my previous commands for installing ActiveMQ and JMS I had no JMS package issues... Any idea about what I'm doing wrong ? Thanks again. Regards. Le mar. 16 août 2022 à 16:10, Jean-Baptiste Onofré <[email protected]> a écrit : > > That's weird. > > Here's what I just did with Karaf 4.4.1 (on a fresh installation): > > - I tried the broker installation: > > karaf@root()> feature:repo-add spring-legacy > Adding feature url > mvn:org.apache.karaf.features/spring-legacy/4.4.1/xml/features > karaf@root()> feature:repo-add activemq 5.16.5 > Adding feature url mvn:org.apache.activemq/activemq-karaf/5.16.5/xml/features > karaf@root()> feature:install activemq-broker > > - I tried the client installation: > > karaf@root()> feature:repo-add spring-legacy > Adding feature url > mvn:org.apache.karaf.features/spring-legacy/4.4.1/xml/features > karaf@root()> feature:repo-add activemq 5.16.5 > Adding feature url mvn:org.apache.activemq/activemq-karaf/5.16.5/xml/features > karaf@root()> feature:install activemq-client > > So it works just fine. > > You can try this on a fresh install, I'm sure it works. > > Regards > JB > > On Tue, Aug 16, 2022 at 11:20 AM Ephemeris Lappis > <[email protected]> wrote: > > > > Hello. > > > > I've just tried it again on a clean empty Karaf, but it doesn't work : > > > > Adding the repo before installing the features leads to the same > > exception about missing Spring class. > > > > The added repo for spring-legacy seems ok (is it the right version, > > since I set none), but the class is still missing : > > > > repo-list > > Repository | URL > > ----------------------------------+--------------------------------------------------------------------------------------------- > > pax-jms-1.1.0 | > > mvn:org.ops4j.pax.jms/pax-jms-features/1.1.0/xml/features > > org.ops4j.pax.jdbc-1.5.3 | > > mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.5.3/xml/features > > openjpa-3.2.2 | > > mvn:org.apache.openjpa/openjpa-features/3.2.2/xml/features > > framework-4.4.1 | > > mvn:org.apache.karaf.features/framework/4.4.1/xml/features > > aries-jpa-2.7.3 | > > mvn:org.apache.aries.jpa/jpa-features/2.7.3/xml/features > > enterprise-4.4.1 | > > mvn:org.apache.karaf.features/enterprise/4.4.1/xml/features > > spring-legacy-4.4.1 | > > mvn:org.apache.karaf.features/spring-legacy/4.4.1/xml/features > > pax-transx-0.5.0 | > > mvn:org.ops4j.pax.transx/pax-transx-features/0.5.0/xml/features > > hibernate-validator-osgi-features | > > mvn:org.hibernate.validator/hibernate-validator-osgi-karaf-features/7.0.2.Final/xml/features > > org.ops4j.pax.web-8.0.6 | > > mvn:org.ops4j.pax.web/pax-web-features/8.0.6/xml/features > > spring-4.4.1 | > > mvn:org.apache.karaf.features/spring/4.4.1/xml/features > > specs-4.4.1 | > > mvn:org.apache.karaf.features/specs/4.4.1/xml/features > > standard-4.4.1 | > > mvn:org.apache.karaf.features/standard/4.4.1/xml/features > > pax-transx-0.5.2 | > > mvn:org.ops4j.pax.transx/pax-transx-features/0.5.2/xml/features > > org.ops4j.pax.cdi-1.1.4 | > > mvn:org.ops4j.pax.cdi/pax-cdi-features/1.1.4/xml/features > > > > Is this the really right procedure to add ActiveMQ into my Karaf ? > > > > Thanks again. > > > > Regards. > > > > Le mar. 16 août 2022 à 11:07, Jean-Baptiste Onofré <[email protected]> a > > écrit : > > > > > > Hi, > > > > > > you need to add spring-legacy features repository as ActiveMQ 5.16.x > > > uses Spring 4.x. > > > > > > So, you have to do feature:repo-add spring-legacy (you don't have to > > > install spring feature else it would be Spring 5.x). > > > > > > NB: ActiveMQ 5.17.x uses Spring 5.x so you don't need spring-legacy > > > anymore with AMQ 5.17.x. > > > > > > Regards > > > JB > > > > > > On Tue, Aug 16, 2022 at 9:27 AM Ephemeris Lappis > > > <[email protected]> wrote: > > > > > > > > Hello. > > > > > > > > I'm trying to install JMS and ActiveMQ features, considering an > > > > external ActiveMQ 5.16.5 server. > > > > > > > > I've tried installing first features : > > > > feature:install jms > > > > feature:install pax-jms-activemq > > > > > > > > But the second command leads to an exception in the bundle > > > > activemq-osgi for which Spring seems to be missing : > > > > java.lang.ClassNotFoundException: > > > > org.springframework.beans.factory.config.BeanFactoryPostProcessor not > > > > found by org.apache.activemq.activemq-osgi [73] > > > > > > > > And indeed the bundle 73 is failing : > > > > 73 | Failure | 80 | 5.16.1 | activemq-osgi > > > > > > > > I've installed Spring with : > > > > feature:install spring > > > > > > > > and after restarting the failing bundle, it seems ok : > > > > 73 | Active | 80 | 5.16.1 | activemq-osgi > > > > > > > > To be sure of my Karaf state, I've fully reinstalled it, and play the > > > > spring install before the pax-jms-activemq, and all seems fine. > > > > > > > > QUESTION : Is this missing feature a bug ? > > > > > > > > Then I tried to create the connection factory, connecting to my > > > > external ActiveMQ server : > > > > jms:create -t activemq -u application -p secret --url > > > > tcp://localhost:61616 my_amq > > > > > > > > And checked the creation : > > > > jms:connectionfactories > > > > JMS Connection Factory > > > > ---------------------- > > > > jms/my_amq > > > > > > > > And I also see created connections on the ActiveMQ server side. > > > > > > > > I've also tried to send messages : > > > > jms:send jms/my_amq test-queue-1 "TEST001" > > > > > > > > And look at them : > > > > jms:browse jms/my_amq test-queue-1 > > > > Message ID | Content | Charset | > > > > Type | Correlation ID | Delivery Mode | Destination | > > > > Expiration | Priority | Redelivered | ReplyTo | Timestamp > > > > ---------------------------------------------+---------+---------+------+----------------+---------------+----------------------+------------+----------+-------------+---------+------------------------------ > > > > ID:ITEM-S96181-64974-1660634559117-1:1:1:1:1 | TEST001 | UTF-8 | > > > > | | Persistent | queue://test-queue-1 | Never > > > > | 4 | false | | Tue Aug 16 09:22:39 CEST 2022 > > > > > > > > All seems to work... But after some unknown time, or stopping-starting > > > > my Karaf, no jms command works any more. The jms connection factory > > > > doesn't appear... > > > > > > > > QUESTION : What am I missing in my installation procedure ? > > > > > > > > Thanks in advance for your help. > > > > > > > > Regards.
