You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Steuer Heribert <st...@patronas.com> on 2022/05/05 07:56:30 UTC

Problems setting up Karaf with ActiveMQ and Blueprint

Hello,

we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no
longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.

Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19

On a freshly unpacked Karaf instance, I execute the following commands:

feature:repo-add activemq 5.16.4
feature:repo-add camel 3.16.0
feature:repo-refresh

feature:install activemq-broker
feature:install camel-jms
feature:install camel-blueprint


Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:

2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1
org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just
happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.

Cheers,
Heri


org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]
at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]
at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]
at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]
at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]
at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more




Sample route:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route id="test">
        <from uri="activemq://in"/>
        <log message="PROCESSED MESSAGE"/>
        <to uri="activemq://out"/>
      </route>
    </camelContext>

</blueprint>


Re: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

First, I would recommend using the camel-jms component. Remember that
activemq-camel is not deprecated, and camel-activemq doesn't bring
much compared to camel-jms.

Back on your point, you have to provide the destination type on the
URI (queue or topic). So the activemq endpoint URI should look like
activemq:queue:foo where foo is the name of the queue.

Regards
JB

On Thu, May 5, 2022 at 9:56 AM Steuer Heribert <st...@patronas.com> wrote:
>
> Hello,
>
> we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no
> longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.
>
> Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19
>
> On a freshly unpacked Karaf instance, I execute the following commands:
>
> feature:repo-add activemq 5.16.4
> feature:repo-add camel 3.16.0
> feature:repo-refresh
>
> feature:install activemq-broker
> feature:install camel-jms
> feature:install camel-blueprint
>
>
> Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:
>
> 2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
> I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just
> happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.
>
> Cheers,
> Heri
>
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]
> at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]
> at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]
> at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]
> at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]
> at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]
> at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]
> at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]
> at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]
> at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
> at java.lang.Thread.run(Thread.java:833) [?:?]
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
> ... 23 more
> Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments
> at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]
> at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
> at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
> at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
> ... 23 more
> Caused by: java.lang.IllegalArgumentException: wrong number of arguments
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
> at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
> at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]
> at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
> at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
> at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
> ... 23 more
>
>
>
>
> Sample route:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>       <route id="test">
>         <from uri="activemq://in"/>
>         <log message="PROCESSED MESSAGE"/>
>         <to uri="activemq://out"/>
>       </route>
>     </camelContext>
>
> </blueprint>
>

Re: AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Did you see my previous email ? About the topic/queue name format ?

Regards
JB

On Thu, May 12, 2022 at 6:08 PM Steuer Heribert <st...@patronas.com> wrote:
>
> Hello Martin,
>
> unfortunately this is not the case.  We do not use maven projects but install features in Karaf directly. The ones we use are:
>
> feature:install activemq-broker
> feature:install camel-jms
> feature:install camel-blueprint
>
> Also tried adding camel-activemq feature without success.
>
>
> Cheers,
> Heri
>
> ________________________________
> Von: Martin Lichtin <li...@yahoo.com>
> Gesendet: Donnerstag, 12. Mai 2022 17:52
> An: Steuer Heribert <st...@patronas.com>; user@karaf.apache.org <us...@karaf.apache.org>
> Betreff: Re: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
> Hi Heri
>
>
> The dreaded
>
>
>     IllegalArgumentException: wrong number of arguments
>
>
> happens because your're using the Camel ActiveMQ component from "activemq", but with Camel 3 you need to use the component as provided by Camel
>
> So instead of
>
>
>     <dependency>
>       <groupId>org.apache.activemq</groupId>
>       <artifactId>activemq-camel</artifactId>
>     </dependency>
>
> use
>
>
>     <dependency>
>       <groupId>org.apache.camel</groupId>
>       <artifactId>camel-activemq</artifactId>
>     </dependency>
>
>
> - Martin
>
>
> On 05/05/2022 15:13, Steuer Heribert wrote:
>
> Hello Karsten,
>
> thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned
> in the documentation at https://activemq.apache.org/osgi-integration.html.  Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix).
> Both files are default and I did not touch them.
>
> Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/ leads to the same issue.
>
> Would be great if you could point me to the right direction ...
>
>
> Cheers,
> Heri
>
>
>
> ________________________________
> Von: Karsten Blume <ka...@ottoint.com>
> Gesendet: Donnerstag, 5. Mai 2022 12:18
> An: user@karaf.apache.org <us...@karaf.apache.org>
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
> Hello Heribert,
>
> You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,…).
>
>
>
> You could configure the AMQ component as bean including the above parameters, then all “activemq” endpoints in your context use this.
>
> Or you define all the parameters in the endpoint URL.
>
> The camel and karaf examples for AMQ should give a direction.
>
> BR
>
> Karsten
>
>
>
> Von: Steuer Heribert <st...@patronas.com>
> Gesendet: Donnerstag, 5. Mai 2022 11:41
> An: user@karaf.apache.org
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hello Erne,
>
>
>
> thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.
>
>
>
>
>
> 11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
>
>
>
>
> Any other ideas?
>
>
>
> Cheers,
>
> Heri
>
>
>
> ________________________________
>
> Von: Tasi, Erne <e....@cenit.com>
> Gesendet: Donnerstag, 5. Mai 2022 11:09
> An: user@karaf.apache.org <us...@karaf.apache.org>
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel.
>
> At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.
>
>
>
> Cheers,
>
> Erne
>
>
>
> Von: Tasi, Erne
> Gesendet: Donnerstag, 5. Mai 2022 10:42
> An: user@karaf.apache.org
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hi Heri,
>
>
>
> As the Exception states you did not provide all the needed arguments in you=  from and to statements.
>
> According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html> your Route would have to look something like this:
>
>
>
>       <route id="test">
>
>         <from uri="activemq:queue:in"/>
>
>         <log message="Message: ${body}"/>
>
>         <to uri="activemq:queue:out"/>
>
>       </route>
>
>
>
> Best Regards,
>
> Erne
>
>
>
>
>
> Von: Steuer Heribert [mailto:steuer@patronas.com]
> Gesendet: Donnerstag, 5. Mai 2022 09:57
> An: user@karaf.apache.org
> Betreff: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hello,
>
>
>
> we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no
>
> longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.
>
>
>
> Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19
>
>
>
> On a freshly unpacked Karaf instance, I execute the following commands:
>
>
>
> feature:repo-add activemq 5.16.4
>
> feature:repo-add camel 3.16.0
>
> feature:repo-refresh
>
>
>
> feature:install activemq-broker
>
> feature:install camel-jms
>
> feature:install camel-blueprint
>
>
>
> Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:
>
>
>
> 2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
>
>
> I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just
>
> happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.
>
>
>
> Cheers,
>
> Heri
>
>
>
>
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]
>
> at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]
>
> at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]
>
> at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]
>
> at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]
>
> at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]
>
> at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]
>
> at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
>
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
>
> at java.lang.Thread.run(Thread.java:833) [?:?]
>
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
>
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
>
> ... 23 more
>
> Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments
>
> at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]
>
> at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
>
> at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
>
> at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
>
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
>
> ... 23 more
>
> Caused by: java.lang.IllegalArgumentException: wrong number of arguments
>
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
>
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
>
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
>
> at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
>
> at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]
>
> at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
>
> at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
>
> at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
>
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
>
> ... 23 more
>
>
>
>
>
>
>
>
>
> Sample route:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <blueprint
>
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
>
>
>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>
>       <route id="test">
>
>         <from uri="activemq://in"/>
>
>         <log message="PROCESSED MESSAGE"/>
>
>         <to uri="activemq://out"/>
>
>       </route>
>
>     </camelContext>
>
>
>
> </blueprint>

AW: AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Steuer Heribert <st...@patronas.com>.
Hello Martin,

unfortunately this is not the case.  We do not use maven projects but install features in Karaf directly. The ones we use are:

feature:install activemq-broker
feature:install camel-jms
feature:install camel-blueprint

Also tried adding camel-activemq feature without success.


Cheers,
Heri

________________________________
Von: Martin Lichtin <li...@yahoo.com>
Gesendet: Donnerstag, 12. Mai 2022 17:52
An: Steuer Heribert <st...@patronas.com>; user@karaf.apache.org <us...@karaf.apache.org>
Betreff: Re: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Hi Heri


The dreaded


    IllegalArgumentException: wrong number of arguments


happens because your're using the Camel ActiveMQ component from "activemq", but with Camel 3 you need to use the component as provided by Camel

So instead of


    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-camel</artifactId>
    </dependency>


use


    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-activemq</artifactId>
    </dependency>


- Martin


On 05/05/2022 15:13, Steuer Heribert wrote:
Hello Karsten,

thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned
in the documentation at https://activemq.apache.org/osgi-integration.html.  Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix).
Both files are default and I did not touch them.

Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/ leads to the same issue.

Would be great if you could point me to the right direction ...


Cheers,
Heri



________________________________
Von: Karsten Blume <ka...@ottoint.com>
Gesendet: Donnerstag, 5. Mai 2022 12:18
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Hello Heribert,

You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,…).



You could configure the AMQ component as bean including the above parameters, then all “activemq” endpoints in your context use this.

Or you define all the parameters in the endpoint URL.

The camel and karaf examples for AMQ should give a direction.

BR

Karsten



Von: Steuer Heribert <st...@patronas.com>
Gesendet: Donnerstag, 5. Mai 2022 11:41
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hello Erne,



thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.





11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments





Any other ideas?



Cheers,

Heri



________________________________

Von: Tasi, Erne <e....@cenit.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:09
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JFQ%2BxmNkecVRlf3dQTYwq51CQvh86kKid%2BsgnLx6V98%3D&reserved=0>.

At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.



Cheers,

Erne



Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne





Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint



Hello,



we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no

longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.



Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19



On a freshly unpacked Karaf instance, I execute the following commands:



feature:repo-add activemq 5.16.4

feature:repo-add camel 3.16.0

feature:repo-refresh



feature:install activemq-broker

feature:install camel-jms

feature:install camel-blueprint



Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:



2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments



I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just

happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.



Cheers,

Heri





org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more









Sample route:



<?xml version="1.0" encoding="UTF-8"?>

<blueprint

xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2B1I%2B1%2F5AsKEnnwUyUVo0ybIxoDw9H65HbgGEsf8hWdc%3D&reserved=0>"

xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W1N%2Bur%2F2Q04v6kWpxrazvhwobOEGxm1LpNXCmgrgCBo%3D&reserved=0>">



    <camelContext xmlns="http://camel.apache.org/schema/blueprint<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ue0w3OqWZV24X%2BI%2FJzOnjxw1iRmh%2F9jYjg%2F3DZLX7c%3D&reserved=0>">

      <route id="test">

        <from uri="activemq://in"/>

        <log message="PROCESSED MESSAGE"/>

        <to uri="activemq://out"/>

      </route>

    </camelContext>



</blueprint>

Re: AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Martin Lichtin <li...@yahoo.com>.
Hi Heri


The dreaded


     IllegalArgumentException: wrong number of arguments


happens because your're using the Camel ActiveMQ component from 
"activemq", but with Camel 3 you need to use the component as provided 
by Camel

So instead of


     <dependency>
       <groupId>org.apache.activemq</groupId>
       <artifactId>activemq-camel</artifactId>
     </dependency>

use


     <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-activemq</artifactId>
     </dependency>


- Martin


On 05/05/2022 15:13, Steuer Heribert wrote:
> Hello Karsten,
>
> thanks for you reply. The default rollout already provides the 
> file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is 
> also mentioned
> in the documentation at 
> https://activemq.apache.org/osgi-integration.html. Also, the 
> activemq.xml file is present in the etc directory and looks okay for 
> me (compared to the one in Servicemix).
> Both files are default and I did not touch them.
>
> Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/ leads 
> to the same issue.
>
> Would be great if you could point me to the right direction ...
>
>
> Cheers,
> Heri
>
>
>
> ------------------------------------------------------------------------
> *Von:* Karsten Blume <ka...@ottoint.com>
> *Gesendet:* Donnerstag, 5. Mai 2022 12:18
> *An:* user@karaf.apache.org <us...@karaf.apache.org>
> *Betreff:* AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
> Hello Heribert,
>
> You need to use the endpoint or the component parameters to define the 
> broker (URL, user, pwd,…).
>
> You could configure the AMQ component as bean including the above 
> parameters, then all “activemq” endpoints in your context use this.
>
> Or you define all the parameters in the endpoint URL.
>
> The camel and karaf examples for AMQ should give a direction.
>
> BR
>
> Karsten
>
> *Von:*Steuer Heribert <st...@patronas.com>
> *Gesendet:* Donnerstag, 5. Mai 2022 11:41
> *An:* user@karaf.apache.org
> *Betreff:* AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
> Hello Erne,
>
> thanks for your answer. I tried that already which leads to the same 
> exception (see below), just the endpoint looks a little bit different now.
>
> 11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred 
> during starting CamelContext: camel-6
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route 
> test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... 
> because of Failed to resolve endpoint: activemq://queue:in due to: 
> java.lang.IllegalArgumentException: wrong number of arguments
>
> Any other ideas?
>
> Cheers,
>
> Heri
>
> ------------------------------------------------------------------------
>
> *Von:*Tasi, Erne <e....@cenit.com>
> *Gesendet:* Donnerstag, 5. Mai 2022 11:09
> *An:* user@karaf.apache.org <us...@karaf.apache.org>
> *Betreff:* AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
> Sorry, the correct URL to the Documentation would be ActiveMQ :: 
> Apache Camel 
> <https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JFQ%2BxmNkecVRlf3dQTYwq51CQvh86kKid%2BsgnLx6V98%3D&reserved=0>.
>
> At first I could not send the previous mail and afterwards something 
> went wrong as I copy-pasted my original answer.
>
> Cheers,
>
> Erne
>
> *Von:*Tasi, Erne
> *Gesendet:* Donnerstag, 5. Mai 2022 10:42
> *An:* user@karaf.apache.org
> *Betreff:* AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
> Hi Heri,
>
> As the Exception states you did not provide all the needed arguments 
> in you=  from and to statements.
>
> According to the documentation ActiveMQ :: Apache 
> Camel<https://camel.apach= 
> e.org/components/3.16.x/activemq-component.html 
> <https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> 
> your Route would have to look something like this:
>
> <route id="test">
>
> <from uri="activemq:queue:in"/>
>
> <log message="Message: ${body}"/>
>
> <to uri="activemq:queue:out"/>
>
> </route>
>
> Best Regards,
>
> Erne
>
> *Von:*Steuer Heribert [mailto:steuer@patronas.com 
> <ma...@patronas.com>]
> *Gesendet:* Donnerstag, 5. Mai 2022 09:57
> *An:* user@karaf.apache.org
> *Betreff:* Problems setting up Karaf with ActiveMQ and Blueprint
>
> Hello,
>
> we are currently trying to upgrade a couple of old Apache Servicemix 
> installations which came pre-bundled with Karaf, ActiveMQ, Camel and 
> Blueprint support. As it seems that Servicemix is no
>
> longer maintained, I would like to set up a similar instance with 
> Karaf and the appropriate bundles.
>
> Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19
>
> On a freshly unpacked Karaf instance, I execute the following commands:
>
> feature:repo-add activemq 5.16.4
>
> feature:repo-add camel 3.16.0
>
> feature:repo-refresh
>
> feature:install activemq-broker
>
> feature:install camel-jms
>
> feature:install camel-blueprint
>
> Running a simple blueprint route (route attached below) that reads 
> from a queue and writes to another queue fails with:
>
> 2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | 
> BlueprintCamelContext            | 213 - 
> org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred 
> during starting CamelContext: camel-1
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route 
> test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... 
> because of Failed to resolve endpoint: activemq://in due to: 
> java.lang.IllegalArgumentException: wrong number of arguments
>
> I found some issues on the web related to that exception but all 
> points refer to packages that I do not use (activemq-camel). I have 
> attached the full stack trace below for completeness. I am pretty sure 
> that this just
>
> happens because of lack of knowledge, but I did not find a path out of 
> that problem. So hopefully one of you can point me to the right direction.
>
> Cheers,
>
> Heri
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route 
> test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... 
> because of Failed to resolve endpoint: activemq://in due to: 
> java.lang.IllegalArgumentException: wrong number of arguments
>
> at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.support.service.BaseService.init(BaseService.java:83) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:111) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) 
> [!/:3.16.0]
>
> at 
> org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) 
> [!/:1.10.3]
>
> at 
> org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) 
> [!/:1.10.3]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) 
> [?:?]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) 
> [?:?]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) 
> [?:?]
>
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 
> [?:?]
>
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 
> [?:?]
>
> at java.lang.Thread.run(Thread.java:833) [?:?]
>
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to 
> resolve endpoint: activemq://in due to: 
> java.lang.IllegalArgumentException: wrong number of arguments
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) 
> ~[!/:3.16.0]
>
> ... 23 more
>
> Caused by: java.lang.RuntimeException: 
> java.lang.IllegalArgumentException: wrong number of arguments
>
> at 
> org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) 
> ~[!/:3.16.0]
>
> at 
> org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) 
> ~[?:?]
>
> at 
> org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) 
> ~[?:?]
>
> at 
> org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) 
> ~[!/:3.16.0]
>
> ... 23 more
>
> Caused by: java.lang.IllegalArgumentException: wrong number of arguments
>
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method) ~[?:?]
>
> at 
> jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 
> ~[?:?]
>
> at 
> jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
> ~[?:?]
>
> at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
>
> at 
> org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) 
> ~[!/:3.16.0]
>
> at 
> org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) 
> ~[?:?]
>
> at 
> org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) 
> ~[?:?]
>
> at 
> org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) 
> ~[!/:3.16.0]
>
> at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) 
> ~[!/:3.16.0]
>
> ... 23 more
>
> Sample route:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <blueprint
>
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0 
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2B1I%2B1%2F5AsKEnnwUyUVo0ybIxoDw9H65HbgGEsf8hWdc%3D&reserved=0>"
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W1N%2Bur%2F2Q04v6kWpxrazvhwobOEGxm1LpNXCmgrgCBo%3D&reserved=0>">
>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint 
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ue0w3OqWZV24X%2BI%2FJzOnjxw1iRmh%2F9jYjg%2F3DZLX7c%3D&reserved=0>">
>
>       <route id="test">
>
>         <from uri="activemq://in"/>
>
>         <log message="PROCESSED MESSAGE"/>
>
>         <to uri="activemq://out"/>
>
>       </route>
>
>     </camelContext>
>
> </blueprint>
>

Re: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, you have a JMS example in Karaf:

https://github.com/apache/karaf/tree/main/examples/karaf-jms-example

I can add JMS endpoint in Camel example if it would help:
https://github.com/apache/karaf/tree/main/examples/karaf-camel-example

Regards
JB

On Fri, May 6, 2022 at 8:22 AM Karsten Blume <ka...@ottoint.com> wrote:
>
> Hello Heribert,
>
> You need to configure the server AND the client (camel).
>
> It is not sufficient to configure the server only.
>
>
>
> Here: apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-command\src\main\java\org\apache\karaf\examples\jms\command\SendCommand.java
>
> Is an example on how to use a AMQ connection factory by hand. The connection factory is created by some karaf magic/features and cfg files:
> apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-features\src\main\feature\feature.xml
>
> This creates you the conn factory, you could use/reference it in your camel context.
>
>
>
> camel-examples\examples\jms-file\src\main\java\org\apache\camel\example\jmstofile\CamelJmsToFileExample.java
>
> Shows how to connect to a JMS server, first by initializing the Camel Jms-Component, then the usage in the route.
>
> In blueprint it could be a reference to the connection factory (which was created by the feature.xml and cfg file) and with that an initialization of the JMS component bean in your blueprint. Then your route is using the component (with whatever name you choose).
>
> Bye
>
> Karsten
>
>
>
>
>
> Von: Steuer Heribert <st...@patronas.com>
> Gesendet: Donnerstag, 5. Mai 2022 15:13
> An: user@karaf.apache.org
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hello Karsten,
>
>
>
> thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned
>
> in the documentation at https://activemq.apache.org/osgi-integration.html.  Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix).
>
> Both files are default and I did not touch them.
>
>
>
> Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/ leads to the same issue.
>
>
>
> Would be great if you could point me to the right direction ...
>
>
>
>
>
> Cheers,
>
> Heri
>
>
>
>
>
>
>
> ________________________________
>
> Von: Karsten Blume <ka...@ottoint.com>
> Gesendet: Donnerstag, 5. Mai 2022 12:18
> An: user@karaf.apache.org <us...@karaf.apache.org>
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hello Heribert,
>
> You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,…).
>
>
>
> You could configure the AMQ component as bean including the above parameters, then all “activemq” endpoints in your context use this.
>
> Or you define all the parameters in the endpoint URL.
>
> The camel and karaf examples for AMQ should give a direction.
>
> BR
>
> Karsten
>
>
>
> Von: Steuer Heribert <st...@patronas.com>
> Gesendet: Donnerstag, 5. Mai 2022 11:41
> An: user@karaf.apache.org
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hello Erne,
>
>
>
> thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.
>
>
>
>
>
> 11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
>
>
>
>
> Any other ideas?
>
>
>
> Cheers,
>
> Heri
>
>
>
> ________________________________
>
> Von: Tasi, Erne <e....@cenit.com>
> Gesendet: Donnerstag, 5. Mai 2022 11:09
> An: user@karaf.apache.org <us...@karaf.apache.org>
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel.
>
> At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.
>
>
>
> Cheers,
>
> Erne
>
>
>
> Von: Tasi, Erne
> Gesendet: Donnerstag, 5. Mai 2022 10:42
> An: user@karaf.apache.org
> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hi Heri,
>
>
>
> As the Exception states you did not provide all the needed arguments in you=  from and to statements.
>
> According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html> your Route would have to look something like this:
>
>
>
>       <route id="test">
>
>         <from uri="activemq:queue:in"/>
>
>         <log message="Message: ${body}"/>
>
>         <to uri="activemq:queue:out"/>
>
>       </route>
>
>
>
> Best Regards,
>
> Erne
>
>
>
>
>
> Von: Steuer Heribert [mailto:steuer@patronas.com]
> Gesendet: Donnerstag, 5. Mai 2022 09:57
> An: user@karaf.apache.org
> Betreff: Problems setting up Karaf with ActiveMQ and Blueprint
>
>
>
> Hello,
>
>
>
> we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no
>
> longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.
>
>
>
> Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19
>
>
>
> On a freshly unpacked Karaf instance, I execute the following commands:
>
>
>
> feature:repo-add activemq 5.16.4
>
> feature:repo-add camel 3.16.0
>
> feature:repo-refresh
>
>
>
> feature:install activemq-broker
>
> feature:install camel-jms
>
> feature:install camel-blueprint
>
>
>
> Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:
>
>
>
> 2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
>
>
> I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just
>
> happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.
>
>
>
> Cheers,
>
> Heri
>
>
>
>
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]
>
> at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]
>
> at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]
>
> at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]
>
> at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]
>
> at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]
>
> at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]
>
> at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]
>
> at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
>
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
>
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
>
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
>
> at java.lang.Thread.run(Thread.java:833) [?:?]
>
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
>
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
>
> ... 23 more
>
> Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments
>
> at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]
>
> at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
>
> at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
>
> at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
>
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
>
> ... 23 more
>
> Caused by: java.lang.IllegalArgumentException: wrong number of arguments
>
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
>
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
>
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
>
> at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
>
> at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]
>
> at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
>
> at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
>
> at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
>
> at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
>
> at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
>
> at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
>
> ... 23 more
>
>
>
>
>
>
>
>
>
> Sample route:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <blueprint
>
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
>
>
>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>
>       <route id="test">
>
>         <from uri="activemq://in"/>
>
>         <log message="PROCESSED MESSAGE"/>
>
>         <to uri="activemq://out"/>
>
>       </route>
>
>     </camelContext>
>
>
>
> </blueprint>
>
>
>
>
> CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
> Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
> Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
> Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
> Bankverbindungen (Bank Accounts):
> Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
> Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
> Registergericht (Registry court): Amtsgericht Stuttgart
> Handelsregister (Commercial Register): HRB Nr. 19117
> Umsatzsteuer (VAT) ID: DE 147 862 777
>
>
> CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
> Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
> Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
> Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
> Bankverbindungen (Bank Accounts):
> Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
> Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
> Registergericht (Registry court): Amtsgericht Stuttgart
> Handelsregister (Commercial Register): HRB Nr. 19117
> Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Steuer Heribert <st...@patronas.com>.
Thanks Karsten,

I will walk through that stuff and hopefully I get things up and running with that. As I come from the good old Servicemix days, I was wondering as I do not have to configure any kind of
connection factory in the blueprint world (I mainly use blueprint routes, rarely in Java). I just use the entpoint as "activemq://queuename" and things work.

Nevertheless, I will work through the stuff you provided.

Thanks alot,
Heri

________________________________
Von: Karsten Blume <ka...@ottoint.com>
Gesendet: Freitag, 6. Mai 2022 08:22
An: user@karaf.apache.org <us...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Hello Heribert,

You need to configure the server AND the client (camel).

It is not sufficient to configure the server only.



Here: apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-command\src\main\java\org\apache\karaf\examples\jms\command\SendCommand.java

Is an example on how to use a AMQ connection factory by hand. The connection factory is created by some karaf magic/features and cfg files:
apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-features\src\main\feature\feature.xml

This creates you the conn factory, you could use/reference it in your camel context.



camel-examples\examples\jms-file\src\main\java\org\apache\camel\example\jmstofile\CamelJmsToFileExample.java

Shows how to connect to a JMS server, first by initializing the Camel Jms-Component, then the usage in the route.

In blueprint it could be a reference to the connection factory (which was created by the feature.xml and cfg file) and with that an initialization of the JMS component bean in your blueprint. Then your route is using the component (with whatever name you choose).

Bye

Karsten





Von: Steuer Heribert <st...@patronas.com>
Gesendet: Donnerstag, 5. Mai 2022 15:13
An: user@karaf.apache.org
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hello Karsten,



thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned

in the documentation at https://activemq.apache.org/osgi-integration.html<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Factivemq.apache.org%2Fosgi-integration.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=v5EY1%2BcVxWkAfTcrJPJtBUhTG5JRi6rVcoz0rcewnto%3D&reserved=0>.  Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix).

Both files are default and I did not touch them.



Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fliquid-reality.de%2FKaraf-Tutorial%2F05%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LxXWQ3C1U3SKB9pFADsuzhNb3PSDXTB1UjiKG%2BiWto0%3D&reserved=0> leads to the same issue.



Would be great if you could point me to the right direction ...





Cheers,

Heri







________________________________

Von: Karsten Blume <ka...@ottoint.com>>
Gesendet: Donnerstag, 5. Mai 2022 12:18
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hello Heribert,

You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,…).



You could configure the AMQ component as bean including the above parameters, then all “activemq” endpoints in your context use this.

Or you define all the parameters in the endpoint URL.

The camel and karaf examples for AMQ should give a direction.

BR

Karsten



Von: Steuer Heribert <st...@patronas.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:41
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hello Erne,



thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.





11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments





Any other ideas?



Cheers,

Heri



________________________________

Von: Tasi, Erne <e....@cenit.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:09
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1oHOvOFEut185UTWKrnGBL0rZ9Rejogdo9fj4wbxOvY%3D&reserved=0>.

At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.



Cheers,

Erne



Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne





Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint



Hello,



we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no

longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.



Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19



On a freshly unpacked Karaf instance, I execute the following commands:



feature:repo-add activemq 5.16.4

feature:repo-add camel 3.16.0

feature:repo-refresh



feature:install activemq-broker

feature:install camel-jms

feature:install camel-blueprint



Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:



2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments



I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just

happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.



Cheers,

Heri





org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more









Sample route:



<?xml version="1.0" encoding="UTF-8"?>

<blueprint

xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K4wEZQkd2ifG3KeJ8jU%2FgqKD6n6ZAxz6z4bh7%2FylarY%3D&reserved=0>"

xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jYw15fNNfgvCK5Hii46xVXjQ9LQ7%2FZFoCrtrrwc8SKo%3D&reserved=0>">



    <camelContext xmlns="http://camel.apache.org/schema/blueprint<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wjPHTP6QPL%2B3tgU5T8CL5mdljvwSx9JhOUHrdNVqitI%3D&reserved=0>">

      <route id="test">

        <from uri="activemq://in"/>

        <log message="PROCESSED MESSAGE"/>

        <to uri="activemq://out"/>

      </route>

    </camelContext>



</blueprint>



CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwJpPTs51Z2DEWetUj1T8Ry9MuI7j73KktnDsABD5E8%3D&reserved=0>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwJpPTs51Z2DEWetUj1T8Ry9MuI7j73KktnDsABD5E8%3D&reserved=0>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Karsten Blume <ka...@ottoint.com>.
Hello Heribert,
You need to configure the server AND the client (camel).
It is not sufficient to configure the server only.

Here: apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-command\src\main\java\org\apache\karaf\examples\jms\command\SendCommand.java
Is an example on how to use a AMQ connection factory by hand. The connection factory is created by some karaf magic/features and cfg files:
apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-features\src\main\feature\feature.xml
This creates you the conn factory, you could use/reference it in your camel context.

camel-examples\examples\jms-file\src\main\java\org\apache\camel\example\jmstofile\CamelJmsToFileExample.java
Shows how to connect to a JMS server, first by initializing the Camel Jms-Component, then the usage in the route.
In blueprint it could be a reference to the connection factory (which was created by the feature.xml and cfg file) and with that an initialization of the JMS component bean in your blueprint. Then your route is using the component (with whatever name you choose).
Bye
Karsten


Von: Steuer Heribert <st...@patronas.com>
Gesendet: Donnerstag, 5. Mai 2022 15:13
An: user@karaf.apache.org
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint

Hello Karsten,

thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned
in the documentation at https://activemq.apache.org/osgi-integration.html<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Factivemq.apache.org%2Fosgi-integration.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=v5EY1%2BcVxWkAfTcrJPJtBUhTG5JRi6rVcoz0rcewnto%3D&reserved=0>.  Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix).
Both files are default and I did not touch them.

Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fliquid-reality.de%2FKaraf-Tutorial%2F05%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LxXWQ3C1U3SKB9pFADsuzhNb3PSDXTB1UjiKG%2BiWto0%3D&reserved=0> leads to the same issue.

Would be great if you could point me to the right direction ...


Cheers,
Heri



________________________________
Von: Karsten Blume <ka...@ottoint.com>>
Gesendet: Donnerstag, 5. Mai 2022 12:18
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Hello Heribert,

You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,...).



You could configure the AMQ component as bean including the above parameters, then all "activemq" endpoints in your context use this.

Or you define all the parameters in the endpoint URL.

The camel and karaf examples for AMQ should give a direction.

BR

Karsten



Von: Steuer Heribert <st...@patronas.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:41
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hello Erne,



thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.





11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments





Any other ideas?



Cheers,

Heri



________________________________

Von: Tasi, Erne <e....@cenit.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:09
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1oHOvOFEut185UTWKrnGBL0rZ9Rejogdo9fj4wbxOvY%3D&reserved=0>.

At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.



Cheers,

Erne



Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne





Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint



Hello,



we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no

longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.



Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19



On a freshly unpacked Karaf instance, I execute the following commands:



feature:repo-add activemq 5.16.4

feature:repo-add camel 3.16.0

feature:repo-refresh



feature:install activemq-broker

feature:install camel-jms

feature:install camel-blueprint



Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:



2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments



I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just

happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.



Cheers,

Heri





org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more









Sample route:



<?xml version="1.0" encoding="UTF-8"?>

<blueprint

xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K4wEZQkd2ifG3KeJ8jU%2FgqKD6n6ZAxz6z4bh7%2FylarY%3D&reserved=0>"

xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jYw15fNNfgvCK5Hii46xVXjQ9LQ7%2FZFoCrtrrwc8SKo%3D&reserved=0>">



    <camelContext xmlns="http://camel.apache.org/schema/blueprint<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wjPHTP6QPL%2B3tgU5T8CL5mdljvwSx9JhOUHrdNVqitI%3D&reserved=0>">

      <route id="test">

        <from uri="activemq://in"/>

        <log message="PROCESSED MESSAGE"/>

        <to uri="activemq://out"/>

      </route>

    </camelContext>



</blueprint>



CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwJpPTs51Z2DEWetUj1T8Ry9MuI7j73KktnDsABD5E8%3D&reserved=0>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwJpPTs51Z2DEWetUj1T8Ry9MuI7j73KktnDsABD5E8%3D&reserved=0>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Steuer Heribert <st...@patronas.com>.
Hello Karsten,

thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned
in the documentation at https://activemq.apache.org/osgi-integration.html.  Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix).
Both files are default and I did not touch them.

Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/ leads to the same issue.

Would be great if you could point me to the right direction ...


Cheers,
Heri



________________________________
Von: Karsten Blume <ka...@ottoint.com>
Gesendet: Donnerstag, 5. Mai 2022 12:18
An: user@karaf.apache.org <us...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Hello Heribert,

You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,…).



You could configure the AMQ component as bean including the above parameters, then all “activemq” endpoints in your context use this.

Or you define all the parameters in the endpoint URL.

The camel and karaf examples for AMQ should give a direction.

BR

Karsten



Von: Steuer Heribert <st...@patronas.com>
Gesendet: Donnerstag, 5. Mai 2022 11:41
An: user@karaf.apache.org
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hello Erne,



thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.





11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments





Any other ideas?



Cheers,

Heri



________________________________

Von: Tasi, Erne <e....@cenit.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:09
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JFQ%2BxmNkecVRlf3dQTYwq51CQvh86kKid%2BsgnLx6V98%3D&reserved=0>.

At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.



Cheers,

Erne



Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne





Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint



Hello,



we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no

longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.



Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19



On a freshly unpacked Karaf instance, I execute the following commands:



feature:repo-add activemq 5.16.4

feature:repo-add camel 3.16.0

feature:repo-refresh



feature:install activemq-broker

feature:install camel-jms

feature:install camel-blueprint



Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:



2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments



I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just

happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.



Cheers,

Heri





org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more









Sample route:



<?xml version="1.0" encoding="UTF-8"?>

<blueprint

xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2B1I%2B1%2F5AsKEnnwUyUVo0ybIxoDw9H65HbgGEsf8hWdc%3D&reserved=0>"

xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W1N%2Bur%2F2Q04v6kWpxrazvhwobOEGxm1LpNXCmgrgCBo%3D&reserved=0>">



    <camelContext xmlns="http://camel.apache.org/schema/blueprint<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ue0w3OqWZV24X%2BI%2FJzOnjxw1iRmh%2F9jYjg%2F3DZLX7c%3D&reserved=0>">

      <route id="test">

        <from uri="activemq://in"/>

        <log message="PROCESSED MESSAGE"/>

        <to uri="activemq://out"/>

      </route>

    </camelContext>



</blueprint>



CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wQdx530TuACxlaMzzPbxcRFxLhHMqeb4p6SQS3rQMlw%3D&reserved=0>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<http://www.cenit.com>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Karsten Blume <ka...@ottoint.com>.
Hello Heribert,
You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,...).

You could configure the AMQ component as bean including the above parameters, then all "activemq" endpoints in your context use this.
Or you define all the parameters in the endpoint URL.
The camel and karaf examples for AMQ should give a direction.
BR
Karsten

Von: Steuer Heribert <st...@patronas.com>
Gesendet: Donnerstag, 5. Mai 2022 11:41
An: user@karaf.apache.org
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint

Hello Erne,

thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.


11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6
org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments


Any other ideas?

Cheers,
Heri

________________________________
Von: Tasi, Erne <e....@cenit.com>>
Gesendet: Donnerstag, 5. Mai 2022 11:09
An: user@karaf.apache.org<ma...@karaf.apache.org> <us...@karaf.apache.org>>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JFQ%2BxmNkecVRlf3dQTYwq51CQvh86kKid%2BsgnLx6V98%3D&reserved=0>.

At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.



Cheers,

Erne



Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne





Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint



Hello,



we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no

longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.



Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19



On a freshly unpacked Karaf instance, I execute the following commands:



feature:repo-add activemq 5.16.4

feature:repo-add camel 3.16.0

feature:repo-refresh



feature:install activemq-broker

feature:install camel-jms

feature:install camel-blueprint



Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:



2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments



I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just

happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.



Cheers,

Heri





org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more









Sample route:



<?xml version="1.0" encoding="UTF-8"?>

<blueprint

xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2B1I%2B1%2F5AsKEnnwUyUVo0ybIxoDw9H65HbgGEsf8hWdc%3D&reserved=0>"

xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W1N%2Bur%2F2Q04v6kWpxrazvhwobOEGxm1LpNXCmgrgCBo%3D&reserved=0>">



    <camelContext xmlns="http://camel.apache.org/schema/blueprint<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ue0w3OqWZV24X%2BI%2FJzOnjxw1iRmh%2F9jYjg%2F3DZLX7c%3D&reserved=0>">

      <route id="test">

        <from uri="activemq://in"/>

        <log message="PROCESSED MESSAGE"/>

        <to uri="activemq://out"/>

      </route>

    </camelContext>



</blueprint>



CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C82f7811134104a96b6a708da2e7b6737%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873405659914560%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wQdx530TuACxlaMzzPbxcRFxLhHMqeb4p6SQS3rQMlw%3D&reserved=0>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<http://www.cenit.com>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by Steuer Heribert <st...@patronas.com>.
Hello Erne,

thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now.


11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6
org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments


Any other ideas?

Cheers,
Heri

________________________________
Von: Tasi, Erne <e....@cenit.com>
Gesendet: Donnerstag, 5. Mai 2022 11:09
An: user@karaf.apache.org <us...@karaf.apache.org>
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://camel.apache.org/components/3.16.x/activemq-component.html>.

At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.



Cheers,

Erne



Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint



Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne





Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint



Hello,



we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no

longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.



Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19



On a freshly unpacked Karaf instance, I execute the following commands:



feature:repo-add activemq 5.16.4

feature:repo-add camel 3.16.0

feature:repo-refresh



feature:install activemq-broker

feature:install camel-jms

feature:install camel-blueprint



Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:



2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1

org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments



I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just

happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.



Cheers,

Heri





org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]

at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]

at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]

at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]

at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]

at java.lang.Thread.run(Thread.java:833) [?:?]

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more

Caused by: java.lang.IllegalArgumentException: wrong number of arguments

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]

at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]

at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]

at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]

at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]

at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]

at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]

at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]

at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]

... 23 more









Sample route:



<?xml version="1.0" encoding="UTF-8"?>

<blueprint

xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"

xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">



    <camelContext xmlns="http://camel.apache.org/schema/blueprint">

      <route id="test">

        <from uri="activemq://in"/>

        <log message="PROCESSED MESSAGE"/>

        <to uri="activemq://out"/>

      </route>

    </camelContext>



</blueprint>



CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<http://www.cenit.com>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by "Tasi, Erne" <e....@cenit.com>.
Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://camel.apache.org/components/3.16.x/activemq-component.html>.
At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer.

Cheers,
Erne

Von: Tasi, Erne
Gesendet: Donnerstag, 5. Mai 2022 10:42
An: user@karaf.apache.org
Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint


Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne


Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint

Hello,

we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no
longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.

Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19

On a freshly unpacked Karaf instance, I execute the following commands:

feature:repo-add activemq 5.16.4
feature:repo-add camel 3.16.0
feature:repo-refresh

feature:install activemq-broker
feature:install camel-jms
feature:install camel-blueprint

Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:

2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1
org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just
happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.

Cheers,
Heri


org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]
at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]
at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]
at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]
at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]
at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more




Sample route:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route id="test">
        <from uri="activemq://in"/>
        <log message="PROCESSED MESSAGE"/>
        <to uri="activemq://out"/>
      </route>
    </camelContext>

</blueprint>


CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<http://www.cenit.com>
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777

AW: Problems setting up Karaf with ActiveMQ and Blueprint

Posted by "Tasi, Erne" <e....@cenit.com>.
Hi Heri,



As the Exception states you did not provide all the needed arguments in you=  from and to statements.

According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this:



      <route id="test">

        <from uri="activemq:queue:in"/>

        <log message="Message: ${body}"/>

        <to uri="activemq:queue:out"/>

      </route>



Best Regards,

Erne


Von: Steuer Heribert [mailto:steuer@patronas.com]
Gesendet: Donnerstag, 5. Mai 2022 09:57
An: user@karaf.apache.org
Betreff: Problems setting up Karaf with ActiveMQ and Blueprint

Hello,

we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no
longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles.

Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19

On a freshly unpacked Karaf instance, I execute the following commands:

feature:repo-add activemq 5.16.4
feature:repo-add camel 3.16.0
feature:repo-refresh

feature:install activemq-broker
feature:install camel-jms
feature:install camel-blueprint

Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with:

2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext            | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1
org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments

I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just
happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction.

Cheers,
Heri


org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0]
at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0]
at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0]
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0]
at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0]
at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments
at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0]
at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0]
at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?]
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0]
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0]
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0]
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0]
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0]
... 23 more




Sample route:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route id="test">
        <from uri="activemq://in"/>
        <log message="PROCESSED MESSAGE"/>
        <to uri="activemq://out"/>
      </route>
    </camelContext>

</blueprint>


CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta
Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777