You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ephemeris Lappis <ep...@gmail.com> on 2022/08/19 09:35:19 UTC

Component activemq not found

Hello.

I've already asked the question, but probably not clearly...

I don't understand why I can't resolve the dependency for :
org.apache.camel:camel-activemq:jar:2.25.4

I used this component for a long time on old servicemix environments,
and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
ActiveMQ 5.17.1).

The component is still documented on the Camel components list, but I
can't find it.

Any help ?

Thanks in advance.

Regards.

Re: Component activemq not found

Posted by Claus Ibsen <cl...@gmail.com>.
You can create your own activemq component that extends the jms component,
and setup the connection factory and all of that just like the old activemq
component did, and install that in karaf


On Fri, Aug 19, 2022 at 12:35 PM Ephemeris Lappis <
ephemeris.lappis@gmail.com> wrote:

> Hello.
>
> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> I've decided to switch to ActiveMQ 5.17.1.
>
> Before, I think the component camel-activemq was provided by the feature
> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> if I'm not wrong...
>
> I've also tried as you suggested to use the jms component in my routes, but
> the connection factory I've created to connect to my ActiveMQ server is not
> taken into account by the component that requires an explicit connection
> factory... Changing all our about 100 camel projects to change from
> activemq to jms and declare a connection factory reference seems to be a
> very bad choice for us...
>
> So, from both sides I've issues.
>
> Any idea to get out of this sad situation 😥 ?
>
> Thanks a lot !
>
> Regards.
>
> PS: Perhaps the documentation on the component should say that it's
> available "Since Camel 1.0" but also only with restriction after a given
> version...
>
>
> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit
> :
>
> > camel-activemq is not out of the box in Apache Camel in Camel v2.
> > It comes from Apache ActiveMQ 5.x instead.
> >
> > However starting from ActiveMQ 5.17 then they dropped their
> camel-activemq
> > JAR and its no longer available.
> > Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> >
> > In the Camel website make sure to browse the components list for the
> Camel
> > version you use. The list is different per version.
> >
> >
> > On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > ephemeris.lappis@gmail.com> wrote:
> >
> > > Hello.
> > >
> > > I've already asked the question, but probably not clearly...
> > >
> > > I don't understand why I can't resolve the dependency for :
> > > org.apache.camel:camel-activemq:jar:2.25.4
> > >
> > > I used this component for a long time on old servicemix environments,
> > > and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > > ActiveMQ 5.17.1).
> > >
> > > The component is still documented on the Camel components list, but I
> > > can't find it.
> > >
> > > Any help ?
> > >
> > > Thanks in advance.
> > >
> > > Regards.
> > >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Component activemq not found

Posted by ski n <ra...@gmail.com>.
"But I didn't imagine that taking out of the shelves ActiveMQ, Karaf and
Camel versions could be so difficult"

Yes, I know that's why I created Assimbly (assimbly.org) which runs the
latest Camel, ActiveMQ together (from Spring Boot and hopefully Karaf 5 as
well). I am not that far though as Camel, ActiveMQ and ServiceMix are very
extensive to support :)

Regards,

Raymond



On Mon, Aug 22, 2022 at 12:58 PM Ephemeris Lappis <
ephemeris.lappis@gmail.com> wrote:

> Hello.
>
> As you remind us, the end of ServiceMix leads us to find alternative
> solutions. In our context, our more than 100 projects are running today on
> an old redHat Fuse 6.3, and we consider migrating them to a simpler
> solution. Initially, ServiceMix should have been a solution. Now our
> perspective relies on :
> - a separate Active MQ "classic" cluster that is also used out of Camel
> contexts by applications running in another part of our k8s cluster...
> - "raw" Karaf servers with a very basic initial configuration : the
> ActiveMQ client bundles and their dependencies, and the connection factory
> to connect to our MQ cluster
> - repackaging our Fabric8 projects as Karaf features (this should limit
> impacts on our Ansible pipelines that manages provisioning using Jolokia
> API)
>
> But I didn't imagine that taking out of the shelves ActiveMQ, Karaf and
> Camel versions could be so difficult :
> - ActiveMQ 5.16.5 and Karaf 4.4.1 seem to lead to issues between them
> because of some Spring level differences
> - I switched to ActiveMQ 5.17.1 (that also requires an upgrade of our java
> version since 1.8 is not supported anymore)
> - Now the integration with Karaf seems to be better, I can create
> connection factories and test them, but the old Camel component
> "camel-activemq" that was provided by it is not there.
> - So I tried the camel-jms component, but this component seems to be unable
> to take into account the JMS connection factory that has been created.
> - After setting an explicit reference on the connection factory in the
> blueprints, I think that the ActiveMQ bundle of version 2.17.1 manages a
> private package "javax.jms" that hides the publicly exported one...
>
> So... too many issues for something that appeared to be a very simple
> integration work...
>
> Still going ahead :) !
>
> Thanks for your help.
>
> Regards.
>
>
>
> Le lun. 22 août 2022 à 12:00, ski n <ra...@gmail.com> a écrit :
>
> > Hi,
> >
> > I think this is because of the history of Camel and ActiveMQ. Originally
> > Camel was aligned with Apache ServiceMix (https://servicemix.apache.org/
> )
> >
> > ServiceMix contained:
> >
> > - Runtime: Apache Karaf
> > - Several integration tools/frameworks:
> >
> >    - Camel
> >    - ActiveMQ (Classic)
> >    - CXF (Webservices)
> >
> > From the end of Camel 2.x and also Camel 3.x, Camel is not aligned with
> > Apache ServiceMix anymore (ServiceMix is not maintained anymore and
> > probably will become a dormant Apache project in the future).
> >
> > It's since that time that Camel became neutral towards both the runtime
> > used and the broker used.
> >
> > That means you can use as runtime still Karaf, but also Wildfly, Spring
> > Boot, Camel-Main etc.
> >
> > For broker you can use any JMS Broker (like Apache ActiveMQ Classic,
> Apache
> > ActiveMQ Artemis, IBMMQ, SonicMQ, RocketMQ etc) or non-JMS Brokers like
> > RabbitMQ or Apache Kafka. Camel does not favor one or another.
> >
> > In general JMS Brokers are mostly tight to the implementation (like IBMMQ
> > and the version of that Implementation). That means you always need the
> > specific connection factory (which are in the client jars provided by the
> > broker vendor). This is not extremely convenient as you already
> mentioned,
> > but this has always been the case for JMS brokers. As Camel became
> > technology neutral is just follows that convention. In case you like some
> > examples of creating a connection factory for several different brokers:
> >
> >
> >
> https://github.com/assimbly/runtime/blob/master/integration/src/main/java/org/assimbly/integration/service/Connection.java
> >
> > That said I hope that "connections" will become a construct just like
> > components, datasets, beans, languages etc, so that users can attach
> ready
> > made connections to their components. That could be connection to
> brokers,
> > database etc (everything that needs client jar files).
> >
> > As alternative you can also use Apache QPID as a client (
> > https://qpid.apache.org/). QPid has their own broker, but also an
> > universal
> > client that can connect through various brokers using either JMS or even
> > better AMQP (as this is a vendor neutral protocol instead of Java library
> > like JMS. Though note that theory of AMQP can be a little more difficult
> in
> > practice).
> >
> > I hope this give you some background on the reasons behind the changes in
> > the past.
> >
> > Kind regards,
> >
> > Raymond
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Aug 22, 2022 at 9:08 AM Ephemeris Lappis <
> > ephemeris.lappis@gmail.com>
> > wrote:
> >
> > > Hello.
> > >
> > > Sorry for the question about "camel-activeemq" (double e) <>
> > > "camel-activemq". I thought you were talking about another distinct
> Camel
> > > component... camel-activemq is in fact the component i'd like to use...
> > >
> > > I don't understand why using ActiveMQ 2.16.5 and a connection factory
> > that
> > > I create the same way, the camel-activemq is able to detect the unique
> > > instance of the service with no need to add a reference in all our 100+
> > > projects, but the camel-jms do not.
> > >
> > > Why the camel-activemq that is clearly documented as the preferred one
> to
> > > connect to ActiveMQ is not provided now in 2.17.1...
> > >
> > > Thanks again.
> > >
> > > Regards.
> > >
> > >
> > > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> > > écrit :
> > >
> > > > Hi,
> > > >
> > > > here's the documentation about camel-activemq:
> > > > https://camel.apache.org/components/3.18.x/activemq-component.html
> > > >
> > > > About the ConnectionFactory, you have to define it as reference in
> > > > your route. You can find an example here:
> > > >
> > > >
> > > >
> > >
> >
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> > > >
> > > >
> > >
> >
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> > > >
> > > > Regards
> > > > JB
> > > >
> > > > On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> > > > <ep...@gmail.com> wrote:
> > > > >
> > > > > Hello.
> > > > >
> > > > > I've never seen any documentation about "camel-activeemq" : what's
> > the
> > > > > feature that provides it ?
> > > > >
> > > > > As I've said before, I've been trying to use camel-jms but
> > surprisingly
> > > > > my unique connection factory is not detected, and the component
> asks
> > > for
> > > > > an explicit declaration. I thought that one unique connection
> factory
> > > > > should be taken into account... I've created a unique connection
> > > factory
> > > > > using "jms:create" connecting to an external ActiveMQ, and I've
> > checked
> > > > > that the service is present declaring the right interface. Is
> there a
> > > > > special way of declaring or naming the connexion factory to make it
> > > > > available for routes with camel-jms endpoints ?
> > > > >
> > > > > Thanks a lot for your help.
> > > > >
> > > > > Regards.
> > > > >
> > > > > Ephemeris Lappis
> > > > >
> > > > > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > > > > > That's correct: activemq-camel has been removed.
> > > > > >
> > > > > > You can now use camel-jms (recommended) or camel-activeemq.
> > > > > >
> > > > > > You can wrap your own component if needed, but I would rather
> > update
> > > > > > to camel-jms (not so hard to do).
> > > > > >
> > > > > > Regards
> > > > > > JB
> > > > > >
> > > > > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > > > > > <ep...@gmail.com> wrote:
> > > > > >> Hello.
> > > > > >>
> > > > > >> I've been working before on ActiveMQ 5.16.5, but as this version
> > > > leads to
> > > > > >> too many problems on Karaf 4.4.1 (spring compatibility among
> other
> > > > issues),
> > > > > >> I've decided to switch to ActiveMQ 5.17.1.
> > > > > >>
> > > > > >> Before, I think the component camel-activemq was provided by the
> > > > feature
> > > > > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in
> this
> > > > feature,
> > > > > >> if I'm not wrong...
> > > > > >>
> > > > > >> I've also tried as you suggested to use the jms component in my
> > > > routes, but
> > > > > >> the connection factory I've created to connect to my ActiveMQ
> > server
> > > > is not
> > > > > >> taken into account by the component that requires an explicit
> > > > connection
> > > > > >> factory... Changing all our about 100 camel projects to change
> > from
> > > > > >> activemq to jms and declare a connection factory reference seems
> > to
> > > > be a
> > > > > >> very bad choice for us...
> > > > > >>
> > > > > >> So, from both sides I've issues.
> > > > > >>
> > > > > >> Any idea to get out of this sad situation 😥 ?
> > > > > >>
> > > > > >> Thanks a lot !
> > > > > >>
> > > > > >> Regards.
> > > > > >>
> > > > > >> PS: Perhaps the documentation on the component should say that
> > it's
> > > > > >> available "Since Camel 1.0" but also only with restriction
> after a
> > > > given
> > > > > >> version...
> > > > > >>
> > > > > >>
> > > > > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <
> claus.ibsen@gmail.com>
> > a
> > > > écrit :
> > > > > >>
> > > > > >>> camel-activemq is not out of the box in Apache Camel in Camel
> v2.
> > > > > >>> It comes from Apache ActiveMQ 5.x instead.
> > > > > >>>
> > > > > >>> However starting from ActiveMQ 5.17 then they dropped their
> > > > camel-activemq
> > > > > >>> JAR and its no longer available.
> > > > > >>> Instead use the generic camel-jms instead. Or go back to
> ActiveMQ
> > > > 5.16.x
> > > > > >>>
> > > > > >>> In the Camel website make sure to browse the components list
> for
> > > the
> > > > Camel
> > > > > >>> version you use. The list is different per version.
> > > > > >>>
> > > > > >>>
> > > > > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > > > > >>> ephemeris.lappis@gmail.com> wrote:
> > > > > >>>
> > > > > >>>> Hello.
> > > > > >>>>
> > > > > >>>> I've already asked the question, but probably not clearly...
> > > > > >>>>
> > > > > >>>> I don't understand why I can't resolve the dependency for :
> > > > > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > > > > >>>>
> > > > > >>>> I used this component for a long time on old servicemix
> > > > environments,
> > > > > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4
> > > (and
> > > > > >>>> ActiveMQ 5.17.1).
> > > > > >>>>
> > > > > >>>> The component is still documented on the Camel components
> list,
> > > but
> > > > I
> > > > > >>>> can't find it.
> > > > > >>>>
> > > > > >>>> Any help ?
> > > > > >>>>
> > > > > >>>> Thanks in advance.
> > > > > >>>>
> > > > > >>>> Regards.
> > > > > >>>>
> > > > > >>>
> > > > > >>> --
> > > > > >>> Claus Ibsen
> > > > > >>> -----------------
> > > > > >>> http://davsclaus.com @davsclaus
> > > > > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > > > > >>>
> > > > >
> > > > > --
> > > > > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > > > > www.avast.com
> > > >
> > >
> >
>

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

As you remind us, the end of ServiceMix leads us to find alternative
solutions. In our context, our more than 100 projects are running today on
an old redHat Fuse 6.3, and we consider migrating them to a simpler
solution. Initially, ServiceMix should have been a solution. Now our
perspective relies on :
- a separate Active MQ "classic" cluster that is also used out of Camel
contexts by applications running in another part of our k8s cluster...
- "raw" Karaf servers with a very basic initial configuration : the
ActiveMQ client bundles and their dependencies, and the connection factory
to connect to our MQ cluster
- repackaging our Fabric8 projects as Karaf features (this should limit
impacts on our Ansible pipelines that manages provisioning using Jolokia
API)

But I didn't imagine that taking out of the shelves ActiveMQ, Karaf and
Camel versions could be so difficult :
- ActiveMQ 5.16.5 and Karaf 4.4.1 seem to lead to issues between them
because of some Spring level differences
- I switched to ActiveMQ 5.17.1 (that also requires an upgrade of our java
version since 1.8 is not supported anymore)
- Now the integration with Karaf seems to be better, I can create
connection factories and test them, but the old Camel component
"camel-activemq" that was provided by it is not there.
- So I tried the camel-jms component, but this component seems to be unable
to take into account the JMS connection factory that has been created.
- After setting an explicit reference on the connection factory in the
blueprints, I think that the ActiveMQ bundle of version 2.17.1 manages a
private package "javax.jms" that hides the publicly exported one...

So... too many issues for something that appeared to be a very simple
integration work...

Still going ahead :) !

Thanks for your help.

Regards.



Le lun. 22 août 2022 à 12:00, ski n <ra...@gmail.com> a écrit :

> Hi,
>
> I think this is because of the history of Camel and ActiveMQ. Originally
> Camel was aligned with Apache ServiceMix (https://servicemix.apache.org/)
>
> ServiceMix contained:
>
> - Runtime: Apache Karaf
> - Several integration tools/frameworks:
>
>    - Camel
>    - ActiveMQ (Classic)
>    - CXF (Webservices)
>
> From the end of Camel 2.x and also Camel 3.x, Camel is not aligned with
> Apache ServiceMix anymore (ServiceMix is not maintained anymore and
> probably will become a dormant Apache project in the future).
>
> It's since that time that Camel became neutral towards both the runtime
> used and the broker used.
>
> That means you can use as runtime still Karaf, but also Wildfly, Spring
> Boot, Camel-Main etc.
>
> For broker you can use any JMS Broker (like Apache ActiveMQ Classic, Apache
> ActiveMQ Artemis, IBMMQ, SonicMQ, RocketMQ etc) or non-JMS Brokers like
> RabbitMQ or Apache Kafka. Camel does not favor one or another.
>
> In general JMS Brokers are mostly tight to the implementation (like IBMMQ
> and the version of that Implementation). That means you always need the
> specific connection factory (which are in the client jars provided by the
> broker vendor). This is not extremely convenient as you already mentioned,
> but this has always been the case for JMS brokers. As Camel became
> technology neutral is just follows that convention. In case you like some
> examples of creating a connection factory for several different brokers:
>
>
> https://github.com/assimbly/runtime/blob/master/integration/src/main/java/org/assimbly/integration/service/Connection.java
>
> That said I hope that "connections" will become a construct just like
> components, datasets, beans, languages etc, so that users can attach ready
> made connections to their components. That could be connection to brokers,
> database etc (everything that needs client jar files).
>
> As alternative you can also use Apache QPID as a client (
> https://qpid.apache.org/). QPid has their own broker, but also an
> universal
> client that can connect through various brokers using either JMS or even
> better AMQP (as this is a vendor neutral protocol instead of Java library
> like JMS. Though note that theory of AMQP can be a little more difficult in
> practice).
>
> I hope this give you some background on the reasons behind the changes in
> the past.
>
> Kind regards,
>
> Raymond
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Aug 22, 2022 at 9:08 AM Ephemeris Lappis <
> ephemeris.lappis@gmail.com>
> wrote:
>
> > Hello.
> >
> > Sorry for the question about "camel-activeemq" (double e) <>
> > "camel-activemq". I thought you were talking about another distinct Camel
> > component... camel-activemq is in fact the component i'd like to use...
> >
> > I don't understand why using ActiveMQ 2.16.5 and a connection factory
> that
> > I create the same way, the camel-activemq is able to detect the unique
> > instance of the service with no need to add a reference in all our 100+
> > projects, but the camel-jms do not.
> >
> > Why the camel-activemq that is clearly documented as the preferred one to
> > connect to ActiveMQ is not provided now in 2.17.1...
> >
> > Thanks again.
> >
> > Regards.
> >
> >
> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> > écrit :
> >
> > > Hi,
> > >
> > > here's the documentation about camel-activemq:
> > > https://camel.apache.org/components/3.18.x/activemq-component.html
> > >
> > > About the ConnectionFactory, you have to define it as reference in
> > > your route. You can find an example here:
> > >
> > >
> > >
> >
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> > >
> > >
> >
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> > >
> > > Regards
> > > JB
> > >
> > > On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> > > <ep...@gmail.com> wrote:
> > > >
> > > > Hello.
> > > >
> > > > I've never seen any documentation about "camel-activeemq" : what's
> the
> > > > feature that provides it ?
> > > >
> > > > As I've said before, I've been trying to use camel-jms but
> surprisingly
> > > > my unique connection factory is not detected, and the component asks
> > for
> > > > an explicit declaration. I thought that one unique connection factory
> > > > should be taken into account... I've created a unique connection
> > factory
> > > > using "jms:create" connecting to an external ActiveMQ, and I've
> checked
> > > > that the service is present declaring the right interface. Is there a
> > > > special way of declaring or naming the connexion factory to make it
> > > > available for routes with camel-jms endpoints ?
> > > >
> > > > Thanks a lot for your help.
> > > >
> > > > Regards.
> > > >
> > > > Ephemeris Lappis
> > > >
> > > > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > > > > That's correct: activemq-camel has been removed.
> > > > >
> > > > > You can now use camel-jms (recommended) or camel-activeemq.
> > > > >
> > > > > You can wrap your own component if needed, but I would rather
> update
> > > > > to camel-jms (not so hard to do).
> > > > >
> > > > > Regards
> > > > > JB
> > > > >
> > > > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > > > > <ep...@gmail.com> wrote:
> > > > >> Hello.
> > > > >>
> > > > >> I've been working before on ActiveMQ 5.16.5, but as this version
> > > leads to
> > > > >> too many problems on Karaf 4.4.1 (spring compatibility among other
> > > issues),
> > > > >> I've decided to switch to ActiveMQ 5.17.1.
> > > > >>
> > > > >> Before, I think the component camel-activemq was provided by the
> > > feature
> > > > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this
> > > feature,
> > > > >> if I'm not wrong...
> > > > >>
> > > > >> I've also tried as you suggested to use the jms component in my
> > > routes, but
> > > > >> the connection factory I've created to connect to my ActiveMQ
> server
> > > is not
> > > > >> taken into account by the component that requires an explicit
> > > connection
> > > > >> factory... Changing all our about 100 camel projects to change
> from
> > > > >> activemq to jms and declare a connection factory reference seems
> to
> > > be a
> > > > >> very bad choice for us...
> > > > >>
> > > > >> So, from both sides I've issues.
> > > > >>
> > > > >> Any idea to get out of this sad situation 😥 ?
> > > > >>
> > > > >> Thanks a lot !
> > > > >>
> > > > >> Regards.
> > > > >>
> > > > >> PS: Perhaps the documentation on the component should say that
> it's
> > > > >> available "Since Camel 1.0" but also only with restriction after a
> > > given
> > > > >> version...
> > > > >>
> > > > >>
> > > > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com>
> a
> > > écrit :
> > > > >>
> > > > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> > > > >>> It comes from Apache ActiveMQ 5.x instead.
> > > > >>>
> > > > >>> However starting from ActiveMQ 5.17 then they dropped their
> > > camel-activemq
> > > > >>> JAR and its no longer available.
> > > > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ
> > > 5.16.x
> > > > >>>
> > > > >>> In the Camel website make sure to browse the components list for
> > the
> > > Camel
> > > > >>> version you use. The list is different per version.
> > > > >>>
> > > > >>>
> > > > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > > > >>> ephemeris.lappis@gmail.com> wrote:
> > > > >>>
> > > > >>>> Hello.
> > > > >>>>
> > > > >>>> I've already asked the question, but probably not clearly...
> > > > >>>>
> > > > >>>> I don't understand why I can't resolve the dependency for :
> > > > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > > > >>>>
> > > > >>>> I used this component for a long time on old servicemix
> > > environments,
> > > > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4
> > (and
> > > > >>>> ActiveMQ 5.17.1).
> > > > >>>>
> > > > >>>> The component is still documented on the Camel components list,
> > but
> > > I
> > > > >>>> can't find it.
> > > > >>>>
> > > > >>>> Any help ?
> > > > >>>>
> > > > >>>> Thanks in advance.
> > > > >>>>
> > > > >>>> Regards.
> > > > >>>>
> > > > >>>
> > > > >>> --
> > > > >>> Claus Ibsen
> > > > >>> -----------------
> > > > >>> http://davsclaus.com @davsclaus
> > > > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > > > >>>
> > > >
> > > > --
> > > > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > > > www.avast.com
> > >
> >
>

Re: Component activemq not found

Posted by ski n <ra...@gmail.com>.
Hi,

I think this is because of the history of Camel and ActiveMQ. Originally
Camel was aligned with Apache ServiceMix (https://servicemix.apache.org/)

ServiceMix contained:

- Runtime: Apache Karaf
- Several integration tools/frameworks:

   - Camel
   - ActiveMQ (Classic)
   - CXF (Webservices)

From the end of Camel 2.x and also Camel 3.x, Camel is not aligned with
Apache ServiceMix anymore (ServiceMix is not maintained anymore and
probably will become a dormant Apache project in the future).

It's since that time that Camel became neutral towards both the runtime
used and the broker used.

That means you can use as runtime still Karaf, but also Wildfly, Spring
Boot, Camel-Main etc.

For broker you can use any JMS Broker (like Apache ActiveMQ Classic, Apache
ActiveMQ Artemis, IBMMQ, SonicMQ, RocketMQ etc) or non-JMS Brokers like
RabbitMQ or Apache Kafka. Camel does not favor one or another.

In general JMS Brokers are mostly tight to the implementation (like IBMMQ
and the version of that Implementation). That means you always need the
specific connection factory (which are in the client jars provided by the
broker vendor). This is not extremely convenient as you already mentioned,
but this has always been the case for JMS brokers. As Camel became
technology neutral is just follows that convention. In case you like some
examples of creating a connection factory for several different brokers:

https://github.com/assimbly/runtime/blob/master/integration/src/main/java/org/assimbly/integration/service/Connection.java

That said I hope that "connections" will become a construct just like
components, datasets, beans, languages etc, so that users can attach ready
made connections to their components. That could be connection to brokers,
database etc (everything that needs client jar files).

As alternative you can also use Apache QPID as a client (
https://qpid.apache.org/). QPid has their own broker, but also an universal
client that can connect through various brokers using either JMS or even
better AMQP (as this is a vendor neutral protocol instead of Java library
like JMS. Though note that theory of AMQP can be a little more difficult in
practice).

I hope this give you some background on the reasons behind the changes in
the past.

Kind regards,

Raymond















On Mon, Aug 22, 2022 at 9:08 AM Ephemeris Lappis <ep...@gmail.com>
wrote:

> Hello.
>
> Sorry for the question about "camel-activeemq" (double e) <>
> "camel-activemq". I thought you were talking about another distinct Camel
> component... camel-activemq is in fact the component i'd like to use...
>
> I don't understand why using ActiveMQ 2.16.5 and a connection factory that
> I create the same way, the camel-activemq is able to detect the unique
> instance of the service with no need to add a reference in all our 100+
> projects, but the camel-jms do not.
>
> Why the camel-activemq that is clearly documented as the preferred one to
> connect to ActiveMQ is not provided now in 2.17.1...
>
> Thanks again.
>
> Regards.
>
>
> Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> écrit :
>
> > Hi,
> >
> > here's the documentation about camel-activemq:
> > https://camel.apache.org/components/3.18.x/activemq-component.html
> >
> > About the ConnectionFactory, you have to define it as reference in
> > your route. You can find an example here:
> >
> >
> >
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> >
> >
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> >
> > Regards
> > JB
> >
> > On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> > <ep...@gmail.com> wrote:
> > >
> > > Hello.
> > >
> > > I've never seen any documentation about "camel-activeemq" : what's the
> > > feature that provides it ?
> > >
> > > As I've said before, I've been trying to use camel-jms but surprisingly
> > > my unique connection factory is not detected, and the component asks
> for
> > > an explicit declaration. I thought that one unique connection factory
> > > should be taken into account... I've created a unique connection
> factory
> > > using "jms:create" connecting to an external ActiveMQ, and I've checked
> > > that the service is present declaring the right interface. Is there a
> > > special way of declaring or naming the connexion factory to make it
> > > available for routes with camel-jms endpoints ?
> > >
> > > Thanks a lot for your help.
> > >
> > > Regards.
> > >
> > > Ephemeris Lappis
> > >
> > > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > > > That's correct: activemq-camel has been removed.
> > > >
> > > > You can now use camel-jms (recommended) or camel-activeemq.
> > > >
> > > > You can wrap your own component if needed, but I would rather update
> > > > to camel-jms (not so hard to do).
> > > >
> > > > Regards
> > > > JB
> > > >
> > > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > > > <ep...@gmail.com> wrote:
> > > >> Hello.
> > > >>
> > > >> I've been working before on ActiveMQ 5.16.5, but as this version
> > leads to
> > > >> too many problems on Karaf 4.4.1 (spring compatibility among other
> > issues),
> > > >> I've decided to switch to ActiveMQ 5.17.1.
> > > >>
> > > >> Before, I think the component camel-activemq was provided by the
> > feature
> > > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this
> > feature,
> > > >> if I'm not wrong...
> > > >>
> > > >> I've also tried as you suggested to use the jms component in my
> > routes, but
> > > >> the connection factory I've created to connect to my ActiveMQ server
> > is not
> > > >> taken into account by the component that requires an explicit
> > connection
> > > >> factory... Changing all our about 100 camel projects to change from
> > > >> activemq to jms and declare a connection factory reference seems to
> > be a
> > > >> very bad choice for us...
> > > >>
> > > >> So, from both sides I've issues.
> > > >>
> > > >> Any idea to get out of this sad situation 😥 ?
> > > >>
> > > >> Thanks a lot !
> > > >>
> > > >> Regards.
> > > >>
> > > >> PS: Perhaps the documentation on the component should say that it's
> > > >> available "Since Camel 1.0" but also only with restriction after a
> > given
> > > >> version...
> > > >>
> > > >>
> > > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a
> > écrit :
> > > >>
> > > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> > > >>> It comes from Apache ActiveMQ 5.x instead.
> > > >>>
> > > >>> However starting from ActiveMQ 5.17 then they dropped their
> > camel-activemq
> > > >>> JAR and its no longer available.
> > > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ
> > 5.16.x
> > > >>>
> > > >>> In the Camel website make sure to browse the components list for
> the
> > Camel
> > > >>> version you use. The list is different per version.
> > > >>>
> > > >>>
> > > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > > >>> ephemeris.lappis@gmail.com> wrote:
> > > >>>
> > > >>>> Hello.
> > > >>>>
> > > >>>> I've already asked the question, but probably not clearly...
> > > >>>>
> > > >>>> I don't understand why I can't resolve the dependency for :
> > > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > > >>>>
> > > >>>> I used this component for a long time on old servicemix
> > environments,
> > > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4
> (and
> > > >>>> ActiveMQ 5.17.1).
> > > >>>>
> > > >>>> The component is still documented on the Camel components list,
> but
> > I
> > > >>>> can't find it.
> > > >>>>
> > > >>>> Any help ?
> > > >>>>
> > > >>>> Thanks in advance.
> > > >>>>
> > > >>>> Regards.
> > > >>>>
> > > >>>
> > > >>> --
> > > >>> Claus Ibsen
> > > >>> -----------------
> > > >>> http://davsclaus.com @davsclaus
> > > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > > >>>
> > >
> > > --
> > > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > > www.avast.com
> >
>

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

Sorry for the question about "camel-activeemq" (double e) <>
"camel-activemq". I thought you were talking about another distinct Camel
component... camel-activemq is in fact the component i'd like to use...

I don't understand why using ActiveMQ 2.16.5 and a connection factory that
I create the same way, the camel-activemq is able to detect the unique
instance of the service with no need to add a reference in all our 100+
projects, but the camel-jms do not.

Why the camel-activemq that is clearly documented as the preferred one to
connect to ActiveMQ is not provided now in 2.17.1...

Thanks again.

Regards.


Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a
écrit :

> Hi,
>
> here's the documentation about camel-activemq:
> https://camel.apache.org/components/3.18.x/activemq-component.html
>
> About the ConnectionFactory, you have to define it as reference in
> your route. You can find an example here:
>
>
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
>
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
>
> Regards
> JB
>
> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> <ep...@gmail.com> wrote:
> >
> > Hello.
> >
> > I've never seen any documentation about "camel-activeemq" : what's the
> > feature that provides it ?
> >
> > As I've said before, I've been trying to use camel-jms but surprisingly
> > my unique connection factory is not detected, and the component asks for
> > an explicit declaration. I thought that one unique connection factory
> > should be taken into account... I've created a unique connection factory
> > using "jms:create" connecting to an external ActiveMQ, and I've checked
> > that the service is present declaring the right interface. Is there a
> > special way of declaring or naming the connexion factory to make it
> > available for routes with camel-jms endpoints ?
> >
> > Thanks a lot for your help.
> >
> > Regards.
> >
> > Ephemeris Lappis
> >
> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > > That's correct: activemq-camel has been removed.
> > >
> > > You can now use camel-jms (recommended) or camel-activeemq.
> > >
> > > You can wrap your own component if needed, but I would rather update
> > > to camel-jms (not so hard to do).
> > >
> > > Regards
> > > JB
> > >
> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > > <ep...@gmail.com> wrote:
> > >> Hello.
> > >>
> > >> I've been working before on ActiveMQ 5.16.5, but as this version
> leads to
> > >> too many problems on Karaf 4.4.1 (spring compatibility among other
> issues),
> > >> I've decided to switch to ActiveMQ 5.17.1.
> > >>
> > >> Before, I think the component camel-activemq was provided by the
> feature
> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this
> feature,
> > >> if I'm not wrong...
> > >>
> > >> I've also tried as you suggested to use the jms component in my
> routes, but
> > >> the connection factory I've created to connect to my ActiveMQ server
> is not
> > >> taken into account by the component that requires an explicit
> connection
> > >> factory... Changing all our about 100 camel projects to change from
> > >> activemq to jms and declare a connection factory reference seems to
> be a
> > >> very bad choice for us...
> > >>
> > >> So, from both sides I've issues.
> > >>
> > >> Any idea to get out of this sad situation 😥 ?
> > >>
> > >> Thanks a lot !
> > >>
> > >> Regards.
> > >>
> > >> PS: Perhaps the documentation on the component should say that it's
> > >> available "Since Camel 1.0" but also only with restriction after a
> given
> > >> version...
> > >>
> > >>
> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a
> écrit :
> > >>
> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> > >>> It comes from Apache ActiveMQ 5.x instead.
> > >>>
> > >>> However starting from ActiveMQ 5.17 then they dropped their
> camel-activemq
> > >>> JAR and its no longer available.
> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ
> 5.16.x
> > >>>
> > >>> In the Camel website make sure to browse the components list for the
> Camel
> > >>> version you use. The list is different per version.
> > >>>
> > >>>
> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > >>> ephemeris.lappis@gmail.com> wrote:
> > >>>
> > >>>> Hello.
> > >>>>
> > >>>> I've already asked the question, but probably not clearly...
> > >>>>
> > >>>> I don't understand why I can't resolve the dependency for :
> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > >>>>
> > >>>> I used this component for a long time on old servicemix
> environments,
> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > >>>> ActiveMQ 5.17.1).
> > >>>>
> > >>>> The component is still documented on the Camel components list, but
> I
> > >>>> can't find it.
> > >>>>
> > >>>> Any help ?
> > >>>>
> > >>>> Thanks in advance.
> > >>>>
> > >>>> Regards.
> > >>>>
> > >>>
> > >>> --
> > >>> Claus Ibsen
> > >>> -----------------
> > >>> http://davsclaus.com @davsclaus
> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > >>>
> >
> > --
> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > www.avast.com
>

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

For sure, I didn't get your point about capabilities. As in my case
the JMS and JDBC services are provided by features outside of the
scope of all my applicative bundles and features, how do you consider
I should provide a "capability" for them, and thus let the resolver
satisfied ? I've seen your example with a feature group where a JDBC
service is "self provided" by one feature. How can I tell the feature
resolver that the capabilities for my two service references are going
to be provided by other means ?

Thanks a lot for your help and "teaching" (I'm sure others also need
lessons about features and capabilities) !

Regards.

Le jeu. 25 août 2022 à 16:06, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>
> Hi,
>
> It's normal that the bundle works outside of the feature: it's the
> feature resolver who checks the requirements/capabilities of the
> bundles/features.
>
> And you didn't get my point: the fact that a ConnectionFactory service
> is there or not at runtime doesn't matter. The most important is to
> have a bundle/feature that provides the service capability (not the
> service itself).
>
> Regards
> JB
>
> On Thu, Aug 25, 2022 at 1:45 PM Ephemeris Lappis
> <ep...@gmail.com> wrote:
> >
> > Hello.
> >
> > You've probably not seen my own answers on the post to update it with
> > my last tests :
> > - the bundle has no problem when installed out of the feature, and I
> > think the service manifest itself is not the issue
> > - In this manifest, I understand the requirement on the jms service,
> > but the existing connection factory should satisfy it
> > - why the similar jdbc datasource requirement is processed as expected
> > and doesn't lead to a similar issue ?
> > - Disabling the serviceRequirements in the feature configuration, the
> > feature installer works as expected.
> >
> > I agree with you, I'm going to post a new message on the Karaf list.
> >
> > Do you think that in my new post I should mention a Karaf feature
> > installer's (its "resolver") issue, since the bundle installer has no
> > problem finding the existing services to satisfy requirements ?
> >
> > Thanks again.
> >
> > Le jeu. 25 août 2022 à 07:23, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> > >
> > > Hi,
> > >
> > > you have a requirement in your bundle: it's the Import-Service
> > > statement. The problem comes from there: it's nothing about the
> > > runtime.
> > >
> > > I would recommend adding configuration to maven-bundle-plugin to not
> > > put this requirement in your bundle MANIFEST.
> > >
> > > I already answered similar questions on the Karaf mailing list several times.
> > >
> > > By the way, this kind of question should be discussed on the Karaf
> > > mailing list IMHO.
> > >
> > > Regards
> > > JB
> > >
> > > On Tue, Aug 23, 2022 at 10:35 AM Ephemeris Lappis
> > > <ep...@gmail.com> wrote:
> > > >
> > > > Hello again !
> > > >
> > > > Well, I'm not sure I understand what you mean about "requirements" in my bundle. I have no requirement in my manifest. Here the full copy of the manifest :
> > > >
> > > > Manifest-Version: 1.0
> > > > Bnd-LastModified: 1661240801094
> > > > Build-Jdk-Spec: 1.8
> > > > Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
> > > > Bundle-Description: Fifi-T26 :: Camel routes
> > > > Bundle-ManifestVersion: 2
> > > > Bundle-Name: Fifi-T26 :: Camel
> > > > Bundle-SymbolicName: my-test-26-karaf-2-routes
> > > > Bundle-Version: 0.0.1.SNAPSHOT
> > > > Created-By: Apache Maven Bundle Plugin 5.1.8
> > > > DynamicImport-Package: groovy.*,org.codehaus.groovy.*
> > > > Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
> > > >  )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
> > > >  on="[1.0.0,2.0.0)"
> > > > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> > > >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> > > >  ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
> > > >  jndi.service.name=jdbc/fifi)
> > > > Tool: Bnd-6.3.1.202206071316
> > > >
> > > > I aim to provide my bundle (and all similar bundles in our projects) as a feature, with dependencies that pull all the common features. For that I have created a global common feature, and for  every applicative bundle, this feature is referenced as a prerequisite. Here are the bundle feature and the common one :
> > > >
> > > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > > > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes">
> > > >     <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
> > > >     <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT">
> > > >         <details>Fifi-T26 :: Camel routes - Configuration</details>
> > > >         <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
> > > >     </feature>
> > > >     <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT">
> > > >         <details>Fifi-T26 :: Camel routes</details>
> > > >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-x-feature</feature>
> > > >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>
> > > >         <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
> > > >     </feature>
> > > > </features>
> > > >
> > > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > > > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf">
> > > >     <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
> > > >     <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT">
> > > >         <details>Fifi-T26 :: Feature Definition</details>
> > > >         <feature>transaction</feature>
> > > >         <feature version="2.25.4">camel-spring</feature>
> > > >         <feature version="2.25.4">camel-blueprint</feature>
> > > >         <feature version="2.25.4">camel-groovy</feature>
> > > >         <feature version="2.25.4">camel-csv</feature>
> > > >         <feature version="2.25.4">camel-jms</feature>
> > > >         <feature version="2.25.4">camel-sql</feature>
> > > >         <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
> > > >         <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
> > > >     </feature>
> > > > </features>
> > > >
> > > > The error happens when I try to install my bundle as a feature :
> > > > repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
> > > > feature:install my-test-26-karaf-2-routes
> > > >
> > > > All the dependent features and their bundles are installed and started as expected, and when my bundle is deployed, the missing jms service message appears, and the operation fails.
> > > >
> > > > org.apache.felix.resolver.reason.ReasonException: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"
> > > >
> > > > BUT when I install my bundle manually, it works : no missing service !
> > > >
> > > > bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT
> > > >
> > > > The referenced services (my custom ones, a data source and the jms connection factory) are all found without any problem, and my routes are started, and work as expected, including XA transactions...
> > > >
> > > > What's wrong when the bundle is deployed using its feature ? What is the difference between a raw bundle installing and doing the same using the feature ?
> > > >
> > > > Thanks again for your help.
> > > >
> > > > Regards.
> > > >
> > > >
> > > > Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> > > >>
> > > >> Hi,
> > > >>
> > > >> That's not a problem of package but of OSGi requirement.
> > > >>
> > > >> You can do:
> > > >> - do not include requirement in your my-test... bundle
> > > >> - provide the capability in your feature (similar to
> > > >> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)
> > > >>
> > > >> IMHO, the easiest way is to avoid requirement in your bundle (adding
> > > >> this to the maven-bundle-plugin configuration).
> > > >>
> > > >> So, there's no problem with the packages, etc. The problem is simply
> > > >> the requirement in your bundle (you can see in the MANIFEST of your
> > > >> bundle, you will see a Require-Capability/Require-Service
> > > >> instructions).
> > > >>
> > > >> Regards
> > > >> JB
> > > >>
> > > >> See:
> > > >>
> > > >> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
> > > >> <ep...@gmail.com> wrote:
> > > >> >
> > > >> > Hello again.
> > > >> >
> > > >> > As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
> > > >> >
> > > >> > In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
> > > >> > karaf@root()> exports | grep javax.jms
> > > >> > javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
> > > >> > javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
> > > >> >
> > > >> > In my blueprints I've added the service reference, and used it on my JMS routes :
> > > >> >  <reference
> > > >> >     id="myJMS"
> > > >> >     interface="javax.jms.ConnectionFactory"
> > > >> >     availability="mandatory" />
> > > >> >
> > > >> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
> > > >> >
> > > >> > My bundle's manifest imports the correct package and service :
> > > >> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
> > > >> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
> > > >> >  nt;version="[1.0.0,2.0.0)"
> > > >> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> > > >> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> > > >> >  ry;multiple:=false
> > > >> >
> > > >> > The service seems to be present on Karaf :
> > > >> >
> > > >> > karaf@root()> jms:connectionfactories
> > > >> > JMS Connection Factory
> > > >> > ──────────────────────
> > > >> > jms/my_amq
> > > >> >
> > > >> > and with service:list :
> > > >> >
> > > >> > [javax.jms.ConnectionFactory]
> > > >> > -----------------------------
> > > >> >  name = my_amq
> > > >> >  osgi.jndi.service.name = jms/my_amq
> > > >> >  password = secret
> > > >> >  pax.jms.managed = true
> > > >> >  service.bundleid = 93
> > > >> >  service.factoryPid = org.ops4j.connectionfactory
> > > >> >  service.id = 147
> > > >> >  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
> > > >> >  service.scope = singleton
> > > >> >  type = activemq
> > > >> >  url = tcp://localhost:61616
> > > >> >  user = application
> > > >> > Provided by :
> > > >> >  OPS4J Pax JMS Config (93)
> > > >> > Used by:
> > > >> >  System Bundle (0)
> > > >> >
> > > >> > [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
> > > >> >
> > > >> > But when installing my feature, the services do not match, and I have the following error :( !!!
> > > >> >
> > > >> > Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
> > > >> >
> > > >> > I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
> > > >> >
> > > >> > Inspecting the ActiveMQ OSGi bundle :
> > > >> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
> > > >> >
> > > >> > I saw that it also gets the class, but doesn't export it :
> > > >> >
> > > >> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
> > > >> > javax/jms/ConnectionFactory.class | exported: false
> > > >> >
> > > >> > Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
> > > >> >
> > > >> > With previous versions of ActiveMQ I think it was working...
> > > >> >
> > > >> > Thanks a lot for your help.
> > > >> >
> > > >> > Regards.
> > > >> >
> > > >> >
> > > >> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> > > >> >>
> > > >> >> Hi,
> > > >> >>
> > > >> >> here's the documentation about camel-activemq:
> > > >> >> https://camel.apache.org/components/3.18.x/activemq-component.html
> > > >> >>
> > > >> >> About the ConnectionFactory, you have to define it as reference in
> > > >> >> your route. You can find an example here:
> > > >> >>
> > > >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> > > >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> > > >> >>
> > > >> >> Regards
> > > >> >> JB
> > > >> >>
> > > >> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> > > >> >> <ep...@gmail.com> wrote:
> > > >> >> >
> > > >> >> > Hello.
> > > >> >> >
> > > >> >> > I've never seen any documentation about "camel-activeemq" : what's the
> > > >> >> > feature that provides it ?
> > > >> >> >
> > > >> >> > As I've said before, I've been trying to use camel-jms but surprisingly
> > > >> >> > my unique connection factory is not detected, and the component asks for
> > > >> >> > an explicit declaration. I thought that one unique connection factory
> > > >> >> > should be taken into account... I've created a unique connection factory
> > > >> >> > using "jms:create" connecting to an external ActiveMQ, and I've checked
> > > >> >> > that the service is present declaring the right interface. Is there a
> > > >> >> > special way of declaring or naming the connexion factory to make it
> > > >> >> > available for routes with camel-jms endpoints ?
> > > >> >> >
> > > >> >> > Thanks a lot for your help.
> > > >> >> >
> > > >> >> > Regards.
> > > >> >> >
> > > >> >> > Ephemeris Lappis
> > > >> >> >
> > > >> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > > >> >> > > That's correct: activemq-camel has been removed.
> > > >> >> > >
> > > >> >> > > You can now use camel-jms (recommended) or camel-activeemq.
> > > >> >> > >
> > > >> >> > > You can wrap your own component if needed, but I would rather update
> > > >> >> > > to camel-jms (not so hard to do).
> > > >> >> > >
> > > >> >> > > Regards
> > > >> >> > > JB
> > > >> >> > >
> > > >> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > > >> >> > > <ep...@gmail.com> wrote:
> > > >> >> > >> Hello.
> > > >> >> > >>
> > > >> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> > > >> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> > > >> >> > >> I've decided to switch to ActiveMQ 5.17.1.
> > > >> >> > >>
> > > >> >> > >> Before, I think the component camel-activemq was provided by the feature
> > > >> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> > > >> >> > >> if I'm not wrong...
> > > >> >> > >>
> > > >> >> > >> I've also tried as you suggested to use the jms component in my routes, but
> > > >> >> > >> the connection factory I've created to connect to my ActiveMQ server is not
> > > >> >> > >> taken into account by the component that requires an explicit connection
> > > >> >> > >> factory... Changing all our about 100 camel projects to change from
> > > >> >> > >> activemq to jms and declare a connection factory reference seems to be a
> > > >> >> > >> very bad choice for us...
> > > >> >> > >>
> > > >> >> > >> So, from both sides I've issues.
> > > >> >> > >>
> > > >> >> > >> Any idea to get out of this sad situation 😥 ?
> > > >> >> > >>
> > > >> >> > >> Thanks a lot !
> > > >> >> > >>
> > > >> >> > >> Regards.
> > > >> >> > >>
> > > >> >> > >> PS: Perhaps the documentation on the component should say that it's
> > > >> >> > >> available "Since Camel 1.0" but also only with restriction after a given
> > > >> >> > >> version...
> > > >> >> > >>
> > > >> >> > >>
> > > >> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
> > > >> >> > >>
> > > >> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> > > >> >> > >>> It comes from Apache ActiveMQ 5.x instead.
> > > >> >> > >>>
> > > >> >> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> > > >> >> > >>> JAR and its no longer available.
> > > >> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> > > >> >> > >>>
> > > >> >> > >>> In the Camel website make sure to browse the components list for the Camel
> > > >> >> > >>> version you use. The list is different per version.
> > > >> >> > >>>
> > > >> >> > >>>
> > > >> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > > >> >> > >>> ephemeris.lappis@gmail.com> wrote:
> > > >> >> > >>>
> > > >> >> > >>>> Hello.
> > > >> >> > >>>>
> > > >> >> > >>>> I've already asked the question, but probably not clearly...
> > > >> >> > >>>>
> > > >> >> > >>>> I don't understand why I can't resolve the dependency for :
> > > >> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > > >> >> > >>>>
> > > >> >> > >>>> I used this component for a long time on old servicemix environments,
> > > >> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > > >> >> > >>>> ActiveMQ 5.17.1).
> > > >> >> > >>>>
> > > >> >> > >>>> The component is still documented on the Camel components list, but I
> > > >> >> > >>>> can't find it.
> > > >> >> > >>>>
> > > >> >> > >>>> Any help ?
> > > >> >> > >>>>
> > > >> >> > >>>> Thanks in advance.
> > > >> >> > >>>>
> > > >> >> > >>>> Regards.
> > > >> >> > >>>>
> > > >> >> > >>>
> > > >> >> > >>> --
> > > >> >> > >>> Claus Ibsen
> > > >> >> > >>> -----------------
> > > >> >> > >>> http://davsclaus.com @davsclaus
> > > >> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > > >> >> > >>>
> > > >> >> >
> > > >> >> > --
> > > >> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > > >> >> > www.avast.com

Re: Component activemq not found

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

It's normal that the bundle works outside of the feature: it's the
feature resolver who checks the requirements/capabilities of the
bundles/features.

And you didn't get my point: the fact that a ConnectionFactory service
is there or not at runtime doesn't matter. The most important is to
have a bundle/feature that provides the service capability (not the
service itself).

Regards
JB

On Thu, Aug 25, 2022 at 1:45 PM Ephemeris Lappis
<ep...@gmail.com> wrote:
>
> Hello.
>
> You've probably not seen my own answers on the post to update it with
> my last tests :
> - the bundle has no problem when installed out of the feature, and I
> think the service manifest itself is not the issue
> - In this manifest, I understand the requirement on the jms service,
> but the existing connection factory should satisfy it
> - why the similar jdbc datasource requirement is processed as expected
> and doesn't lead to a similar issue ?
> - Disabling the serviceRequirements in the feature configuration, the
> feature installer works as expected.
>
> I agree with you, I'm going to post a new message on the Karaf list.
>
> Do you think that in my new post I should mention a Karaf feature
> installer's (its "resolver") issue, since the bundle installer has no
> problem finding the existing services to satisfy requirements ?
>
> Thanks again.
>
> Le jeu. 25 août 2022 à 07:23, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> >
> > Hi,
> >
> > you have a requirement in your bundle: it's the Import-Service
> > statement. The problem comes from there: it's nothing about the
> > runtime.
> >
> > I would recommend adding configuration to maven-bundle-plugin to not
> > put this requirement in your bundle MANIFEST.
> >
> > I already answered similar questions on the Karaf mailing list several times.
> >
> > By the way, this kind of question should be discussed on the Karaf
> > mailing list IMHO.
> >
> > Regards
> > JB
> >
> > On Tue, Aug 23, 2022 at 10:35 AM Ephemeris Lappis
> > <ep...@gmail.com> wrote:
> > >
> > > Hello again !
> > >
> > > Well, I'm not sure I understand what you mean about "requirements" in my bundle. I have no requirement in my manifest. Here the full copy of the manifest :
> > >
> > > Manifest-Version: 1.0
> > > Bnd-LastModified: 1661240801094
> > > Build-Jdk-Spec: 1.8
> > > Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
> > > Bundle-Description: Fifi-T26 :: Camel routes
> > > Bundle-ManifestVersion: 2
> > > Bundle-Name: Fifi-T26 :: Camel
> > > Bundle-SymbolicName: my-test-26-karaf-2-routes
> > > Bundle-Version: 0.0.1.SNAPSHOT
> > > Created-By: Apache Maven Bundle Plugin 5.1.8
> > > DynamicImport-Package: groovy.*,org.codehaus.groovy.*
> > > Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
> > >  )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
> > >  on="[1.0.0,2.0.0)"
> > > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> > >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> > >  ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
> > >  jndi.service.name=jdbc/fifi)
> > > Tool: Bnd-6.3.1.202206071316
> > >
> > > I aim to provide my bundle (and all similar bundles in our projects) as a feature, with dependencies that pull all the common features. For that I have created a global common feature, and for  every applicative bundle, this feature is referenced as a prerequisite. Here are the bundle feature and the common one :
> > >
> > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes">
> > >     <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
> > >     <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT">
> > >         <details>Fifi-T26 :: Camel routes - Configuration</details>
> > >         <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
> > >     </feature>
> > >     <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT">
> > >         <details>Fifi-T26 :: Camel routes</details>
> > >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-x-feature</feature>
> > >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>
> > >         <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
> > >     </feature>
> > > </features>
> > >
> > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf">
> > >     <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
> > >     <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT">
> > >         <details>Fifi-T26 :: Feature Definition</details>
> > >         <feature>transaction</feature>
> > >         <feature version="2.25.4">camel-spring</feature>
> > >         <feature version="2.25.4">camel-blueprint</feature>
> > >         <feature version="2.25.4">camel-groovy</feature>
> > >         <feature version="2.25.4">camel-csv</feature>
> > >         <feature version="2.25.4">camel-jms</feature>
> > >         <feature version="2.25.4">camel-sql</feature>
> > >         <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
> > >         <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
> > >     </feature>
> > > </features>
> > >
> > > The error happens when I try to install my bundle as a feature :
> > > repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
> > > feature:install my-test-26-karaf-2-routes
> > >
> > > All the dependent features and their bundles are installed and started as expected, and when my bundle is deployed, the missing jms service message appears, and the operation fails.
> > >
> > > org.apache.felix.resolver.reason.ReasonException: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"
> > >
> > > BUT when I install my bundle manually, it works : no missing service !
> > >
> > > bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT
> > >
> > > The referenced services (my custom ones, a data source and the jms connection factory) are all found without any problem, and my routes are started, and work as expected, including XA transactions...
> > >
> > > What's wrong when the bundle is deployed using its feature ? What is the difference between a raw bundle installing and doing the same using the feature ?
> > >
> > > Thanks again for your help.
> > >
> > > Regards.
> > >
> > >
> > > Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> > >>
> > >> Hi,
> > >>
> > >> That's not a problem of package but of OSGi requirement.
> > >>
> > >> You can do:
> > >> - do not include requirement in your my-test... bundle
> > >> - provide the capability in your feature (similar to
> > >> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)
> > >>
> > >> IMHO, the easiest way is to avoid requirement in your bundle (adding
> > >> this to the maven-bundle-plugin configuration).
> > >>
> > >> So, there's no problem with the packages, etc. The problem is simply
> > >> the requirement in your bundle (you can see in the MANIFEST of your
> > >> bundle, you will see a Require-Capability/Require-Service
> > >> instructions).
> > >>
> > >> Regards
> > >> JB
> > >>
> > >> See:
> > >>
> > >> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
> > >> <ep...@gmail.com> wrote:
> > >> >
> > >> > Hello again.
> > >> >
> > >> > As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
> > >> >
> > >> > In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
> > >> > karaf@root()> exports | grep javax.jms
> > >> > javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
> > >> > javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
> > >> >
> > >> > In my blueprints I've added the service reference, and used it on my JMS routes :
> > >> >  <reference
> > >> >     id="myJMS"
> > >> >     interface="javax.jms.ConnectionFactory"
> > >> >     availability="mandatory" />
> > >> >
> > >> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
> > >> >
> > >> > My bundle's manifest imports the correct package and service :
> > >> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
> > >> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
> > >> >  nt;version="[1.0.0,2.0.0)"
> > >> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> > >> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> > >> >  ry;multiple:=false
> > >> >
> > >> > The service seems to be present on Karaf :
> > >> >
> > >> > karaf@root()> jms:connectionfactories
> > >> > JMS Connection Factory
> > >> > ──────────────────────
> > >> > jms/my_amq
> > >> >
> > >> > and with service:list :
> > >> >
> > >> > [javax.jms.ConnectionFactory]
> > >> > -----------------------------
> > >> >  name = my_amq
> > >> >  osgi.jndi.service.name = jms/my_amq
> > >> >  password = secret
> > >> >  pax.jms.managed = true
> > >> >  service.bundleid = 93
> > >> >  service.factoryPid = org.ops4j.connectionfactory
> > >> >  service.id = 147
> > >> >  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
> > >> >  service.scope = singleton
> > >> >  type = activemq
> > >> >  url = tcp://localhost:61616
> > >> >  user = application
> > >> > Provided by :
> > >> >  OPS4J Pax JMS Config (93)
> > >> > Used by:
> > >> >  System Bundle (0)
> > >> >
> > >> > [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
> > >> >
> > >> > But when installing my feature, the services do not match, and I have the following error :( !!!
> > >> >
> > >> > Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
> > >> >
> > >> > I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
> > >> >
> > >> > Inspecting the ActiveMQ OSGi bundle :
> > >> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
> > >> >
> > >> > I saw that it also gets the class, but doesn't export it :
> > >> >
> > >> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
> > >> > javax/jms/ConnectionFactory.class | exported: false
> > >> >
> > >> > Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
> > >> >
> > >> > With previous versions of ActiveMQ I think it was working...
> > >> >
> > >> > Thanks a lot for your help.
> > >> >
> > >> > Regards.
> > >> >
> > >> >
> > >> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> > >> >>
> > >> >> Hi,
> > >> >>
> > >> >> here's the documentation about camel-activemq:
> > >> >> https://camel.apache.org/components/3.18.x/activemq-component.html
> > >> >>
> > >> >> About the ConnectionFactory, you have to define it as reference in
> > >> >> your route. You can find an example here:
> > >> >>
> > >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> > >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> > >> >>
> > >> >> Regards
> > >> >> JB
> > >> >>
> > >> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> > >> >> <ep...@gmail.com> wrote:
> > >> >> >
> > >> >> > Hello.
> > >> >> >
> > >> >> > I've never seen any documentation about "camel-activeemq" : what's the
> > >> >> > feature that provides it ?
> > >> >> >
> > >> >> > As I've said before, I've been trying to use camel-jms but surprisingly
> > >> >> > my unique connection factory is not detected, and the component asks for
> > >> >> > an explicit declaration. I thought that one unique connection factory
> > >> >> > should be taken into account... I've created a unique connection factory
> > >> >> > using "jms:create" connecting to an external ActiveMQ, and I've checked
> > >> >> > that the service is present declaring the right interface. Is there a
> > >> >> > special way of declaring or naming the connexion factory to make it
> > >> >> > available for routes with camel-jms endpoints ?
> > >> >> >
> > >> >> > Thanks a lot for your help.
> > >> >> >
> > >> >> > Regards.
> > >> >> >
> > >> >> > Ephemeris Lappis
> > >> >> >
> > >> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > >> >> > > That's correct: activemq-camel has been removed.
> > >> >> > >
> > >> >> > > You can now use camel-jms (recommended) or camel-activeemq.
> > >> >> > >
> > >> >> > > You can wrap your own component if needed, but I would rather update
> > >> >> > > to camel-jms (not so hard to do).
> > >> >> > >
> > >> >> > > Regards
> > >> >> > > JB
> > >> >> > >
> > >> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > >> >> > > <ep...@gmail.com> wrote:
> > >> >> > >> Hello.
> > >> >> > >>
> > >> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> > >> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> > >> >> > >> I've decided to switch to ActiveMQ 5.17.1.
> > >> >> > >>
> > >> >> > >> Before, I think the component camel-activemq was provided by the feature
> > >> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> > >> >> > >> if I'm not wrong...
> > >> >> > >>
> > >> >> > >> I've also tried as you suggested to use the jms component in my routes, but
> > >> >> > >> the connection factory I've created to connect to my ActiveMQ server is not
> > >> >> > >> taken into account by the component that requires an explicit connection
> > >> >> > >> factory... Changing all our about 100 camel projects to change from
> > >> >> > >> activemq to jms and declare a connection factory reference seems to be a
> > >> >> > >> very bad choice for us...
> > >> >> > >>
> > >> >> > >> So, from both sides I've issues.
> > >> >> > >>
> > >> >> > >> Any idea to get out of this sad situation 😥 ?
> > >> >> > >>
> > >> >> > >> Thanks a lot !
> > >> >> > >>
> > >> >> > >> Regards.
> > >> >> > >>
> > >> >> > >> PS: Perhaps the documentation on the component should say that it's
> > >> >> > >> available "Since Camel 1.0" but also only with restriction after a given
> > >> >> > >> version...
> > >> >> > >>
> > >> >> > >>
> > >> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
> > >> >> > >>
> > >> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> > >> >> > >>> It comes from Apache ActiveMQ 5.x instead.
> > >> >> > >>>
> > >> >> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> > >> >> > >>> JAR and its no longer available.
> > >> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> > >> >> > >>>
> > >> >> > >>> In the Camel website make sure to browse the components list for the Camel
> > >> >> > >>> version you use. The list is different per version.
> > >> >> > >>>
> > >> >> > >>>
> > >> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > >> >> > >>> ephemeris.lappis@gmail.com> wrote:
> > >> >> > >>>
> > >> >> > >>>> Hello.
> > >> >> > >>>>
> > >> >> > >>>> I've already asked the question, but probably not clearly...
> > >> >> > >>>>
> > >> >> > >>>> I don't understand why I can't resolve the dependency for :
> > >> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > >> >> > >>>>
> > >> >> > >>>> I used this component for a long time on old servicemix environments,
> > >> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > >> >> > >>>> ActiveMQ 5.17.1).
> > >> >> > >>>>
> > >> >> > >>>> The component is still documented on the Camel components list, but I
> > >> >> > >>>> can't find it.
> > >> >> > >>>>
> > >> >> > >>>> Any help ?
> > >> >> > >>>>
> > >> >> > >>>> Thanks in advance.
> > >> >> > >>>>
> > >> >> > >>>> Regards.
> > >> >> > >>>>
> > >> >> > >>>
> > >> >> > >>> --
> > >> >> > >>> Claus Ibsen
> > >> >> > >>> -----------------
> > >> >> > >>> http://davsclaus.com @davsclaus
> > >> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > >> >> > >>>
> > >> >> >
> > >> >> > --
> > >> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > >> >> > www.avast.com

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

You've probably not seen my own answers on the post to update it with
my last tests :
- the bundle has no problem when installed out of the feature, and I
think the service manifest itself is not the issue
- In this manifest, I understand the requirement on the jms service,
but the existing connection factory should satisfy it
- why the similar jdbc datasource requirement is processed as expected
and doesn't lead to a similar issue ?
- Disabling the serviceRequirements in the feature configuration, the
feature installer works as expected.

I agree with you, I'm going to post a new message on the Karaf list.

Do you think that in my new post I should mention a Karaf feature
installer's (its "resolver") issue, since the bundle installer has no
problem finding the existing services to satisfy requirements ?

Thanks again.

Le jeu. 25 août 2022 à 07:23, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>
> Hi,
>
> you have a requirement in your bundle: it's the Import-Service
> statement. The problem comes from there: it's nothing about the
> runtime.
>
> I would recommend adding configuration to maven-bundle-plugin to not
> put this requirement in your bundle MANIFEST.
>
> I already answered similar questions on the Karaf mailing list several times.
>
> By the way, this kind of question should be discussed on the Karaf
> mailing list IMHO.
>
> Regards
> JB
>
> On Tue, Aug 23, 2022 at 10:35 AM Ephemeris Lappis
> <ep...@gmail.com> wrote:
> >
> > Hello again !
> >
> > Well, I'm not sure I understand what you mean about "requirements" in my bundle. I have no requirement in my manifest. Here the full copy of the manifest :
> >
> > Manifest-Version: 1.0
> > Bnd-LastModified: 1661240801094
> > Build-Jdk-Spec: 1.8
> > Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
> > Bundle-Description: Fifi-T26 :: Camel routes
> > Bundle-ManifestVersion: 2
> > Bundle-Name: Fifi-T26 :: Camel
> > Bundle-SymbolicName: my-test-26-karaf-2-routes
> > Bundle-Version: 0.0.1.SNAPSHOT
> > Created-By: Apache Maven Bundle Plugin 5.1.8
> > DynamicImport-Package: groovy.*,org.codehaus.groovy.*
> > Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
> >  )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
> >  on="[1.0.0,2.0.0)"
> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> >  ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
> >  jndi.service.name=jdbc/fifi)
> > Tool: Bnd-6.3.1.202206071316
> >
> > I aim to provide my bundle (and all similar bundles in our projects) as a feature, with dependencies that pull all the common features. For that I have created a global common feature, and for  every applicative bundle, this feature is referenced as a prerequisite. Here are the bundle feature and the common one :
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes">
> >     <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
> >     <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT">
> >         <details>Fifi-T26 :: Camel routes - Configuration</details>
> >         <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
> >     </feature>
> >     <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT">
> >         <details>Fifi-T26 :: Camel routes</details>
> >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-x-feature</feature>
> >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>
> >         <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
> >     </feature>
> > </features>
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf">
> >     <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
> >     <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT">
> >         <details>Fifi-T26 :: Feature Definition</details>
> >         <feature>transaction</feature>
> >         <feature version="2.25.4">camel-spring</feature>
> >         <feature version="2.25.4">camel-blueprint</feature>
> >         <feature version="2.25.4">camel-groovy</feature>
> >         <feature version="2.25.4">camel-csv</feature>
> >         <feature version="2.25.4">camel-jms</feature>
> >         <feature version="2.25.4">camel-sql</feature>
> >         <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
> >         <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
> >     </feature>
> > </features>
> >
> > The error happens when I try to install my bundle as a feature :
> > repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
> > feature:install my-test-26-karaf-2-routes
> >
> > All the dependent features and their bundles are installed and started as expected, and when my bundle is deployed, the missing jms service message appears, and the operation fails.
> >
> > org.apache.felix.resolver.reason.ReasonException: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"
> >
> > BUT when I install my bundle manually, it works : no missing service !
> >
> > bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT
> >
> > The referenced services (my custom ones, a data source and the jms connection factory) are all found without any problem, and my routes are started, and work as expected, including XA transactions...
> >
> > What's wrong when the bundle is deployed using its feature ? What is the difference between a raw bundle installing and doing the same using the feature ?
> >
> > Thanks again for your help.
> >
> > Regards.
> >
> >
> > Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> >>
> >> Hi,
> >>
> >> That's not a problem of package but of OSGi requirement.
> >>
> >> You can do:
> >> - do not include requirement in your my-test... bundle
> >> - provide the capability in your feature (similar to
> >> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)
> >>
> >> IMHO, the easiest way is to avoid requirement in your bundle (adding
> >> this to the maven-bundle-plugin configuration).
> >>
> >> So, there's no problem with the packages, etc. The problem is simply
> >> the requirement in your bundle (you can see in the MANIFEST of your
> >> bundle, you will see a Require-Capability/Require-Service
> >> instructions).
> >>
> >> Regards
> >> JB
> >>
> >> See:
> >>
> >> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
> >> <ep...@gmail.com> wrote:
> >> >
> >> > Hello again.
> >> >
> >> > As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
> >> >
> >> > In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
> >> > karaf@root()> exports | grep javax.jms
> >> > javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
> >> > javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
> >> >
> >> > In my blueprints I've added the service reference, and used it on my JMS routes :
> >> >  <reference
> >> >     id="myJMS"
> >> >     interface="javax.jms.ConnectionFactory"
> >> >     availability="mandatory" />
> >> >
> >> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
> >> >
> >> > My bundle's manifest imports the correct package and service :
> >> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
> >> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
> >> >  nt;version="[1.0.0,2.0.0)"
> >> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> >> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> >> >  ry;multiple:=false
> >> >
> >> > The service seems to be present on Karaf :
> >> >
> >> > karaf@root()> jms:connectionfactories
> >> > JMS Connection Factory
> >> > ──────────────────────
> >> > jms/my_amq
> >> >
> >> > and with service:list :
> >> >
> >> > [javax.jms.ConnectionFactory]
> >> > -----------------------------
> >> >  name = my_amq
> >> >  osgi.jndi.service.name = jms/my_amq
> >> >  password = secret
> >> >  pax.jms.managed = true
> >> >  service.bundleid = 93
> >> >  service.factoryPid = org.ops4j.connectionfactory
> >> >  service.id = 147
> >> >  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
> >> >  service.scope = singleton
> >> >  type = activemq
> >> >  url = tcp://localhost:61616
> >> >  user = application
> >> > Provided by :
> >> >  OPS4J Pax JMS Config (93)
> >> > Used by:
> >> >  System Bundle (0)
> >> >
> >> > [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
> >> >
> >> > But when installing my feature, the services do not match, and I have the following error :( !!!
> >> >
> >> > Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
> >> >
> >> > I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
> >> >
> >> > Inspecting the ActiveMQ OSGi bundle :
> >> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
> >> >
> >> > I saw that it also gets the class, but doesn't export it :
> >> >
> >> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
> >> > javax/jms/ConnectionFactory.class | exported: false
> >> >
> >> > Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
> >> >
> >> > With previous versions of ActiveMQ I think it was working...
> >> >
> >> > Thanks a lot for your help.
> >> >
> >> > Regards.
> >> >
> >> >
> >> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> >> >>
> >> >> Hi,
> >> >>
> >> >> here's the documentation about camel-activemq:
> >> >> https://camel.apache.org/components/3.18.x/activemq-component.html
> >> >>
> >> >> About the ConnectionFactory, you have to define it as reference in
> >> >> your route. You can find an example here:
> >> >>
> >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> >> >>
> >> >> Regards
> >> >> JB
> >> >>
> >> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> >> >> <ep...@gmail.com> wrote:
> >> >> >
> >> >> > Hello.
> >> >> >
> >> >> > I've never seen any documentation about "camel-activeemq" : what's the
> >> >> > feature that provides it ?
> >> >> >
> >> >> > As I've said before, I've been trying to use camel-jms but surprisingly
> >> >> > my unique connection factory is not detected, and the component asks for
> >> >> > an explicit declaration. I thought that one unique connection factory
> >> >> > should be taken into account... I've created a unique connection factory
> >> >> > using "jms:create" connecting to an external ActiveMQ, and I've checked
> >> >> > that the service is present declaring the right interface. Is there a
> >> >> > special way of declaring or naming the connexion factory to make it
> >> >> > available for routes with camel-jms endpoints ?
> >> >> >
> >> >> > Thanks a lot for your help.
> >> >> >
> >> >> > Regards.
> >> >> >
> >> >> > Ephemeris Lappis
> >> >> >
> >> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> >> >> > > That's correct: activemq-camel has been removed.
> >> >> > >
> >> >> > > You can now use camel-jms (recommended) or camel-activeemq.
> >> >> > >
> >> >> > > You can wrap your own component if needed, but I would rather update
> >> >> > > to camel-jms (not so hard to do).
> >> >> > >
> >> >> > > Regards
> >> >> > > JB
> >> >> > >
> >> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> >> >> > > <ep...@gmail.com> wrote:
> >> >> > >> Hello.
> >> >> > >>
> >> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> >> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> >> >> > >> I've decided to switch to ActiveMQ 5.17.1.
> >> >> > >>
> >> >> > >> Before, I think the component camel-activemq was provided by the feature
> >> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> >> >> > >> if I'm not wrong...
> >> >> > >>
> >> >> > >> I've also tried as you suggested to use the jms component in my routes, but
> >> >> > >> the connection factory I've created to connect to my ActiveMQ server is not
> >> >> > >> taken into account by the component that requires an explicit connection
> >> >> > >> factory... Changing all our about 100 camel projects to change from
> >> >> > >> activemq to jms and declare a connection factory reference seems to be a
> >> >> > >> very bad choice for us...
> >> >> > >>
> >> >> > >> So, from both sides I've issues.
> >> >> > >>
> >> >> > >> Any idea to get out of this sad situation 😥 ?
> >> >> > >>
> >> >> > >> Thanks a lot !
> >> >> > >>
> >> >> > >> Regards.
> >> >> > >>
> >> >> > >> PS: Perhaps the documentation on the component should say that it's
> >> >> > >> available "Since Camel 1.0" but also only with restriction after a given
> >> >> > >> version...
> >> >> > >>
> >> >> > >>
> >> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
> >> >> > >>
> >> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> >> >> > >>> It comes from Apache ActiveMQ 5.x instead.
> >> >> > >>>
> >> >> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> >> >> > >>> JAR and its no longer available.
> >> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> >> >> > >>>
> >> >> > >>> In the Camel website make sure to browse the components list for the Camel
> >> >> > >>> version you use. The list is different per version.
> >> >> > >>>
> >> >> > >>>
> >> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> >> >> > >>> ephemeris.lappis@gmail.com> wrote:
> >> >> > >>>
> >> >> > >>>> Hello.
> >> >> > >>>>
> >> >> > >>>> I've already asked the question, but probably not clearly...
> >> >> > >>>>
> >> >> > >>>> I don't understand why I can't resolve the dependency for :
> >> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> >> >> > >>>>
> >> >> > >>>> I used this component for a long time on old servicemix environments,
> >> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> >> >> > >>>> ActiveMQ 5.17.1).
> >> >> > >>>>
> >> >> > >>>> The component is still documented on the Camel components list, but I
> >> >> > >>>> can't find it.
> >> >> > >>>>
> >> >> > >>>> Any help ?
> >> >> > >>>>
> >> >> > >>>> Thanks in advance.
> >> >> > >>>>
> >> >> > >>>> Regards.
> >> >> > >>>>
> >> >> > >>>
> >> >> > >>> --
> >> >> > >>> Claus Ibsen
> >> >> > >>> -----------------
> >> >> > >>> http://davsclaus.com @davsclaus
> >> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> >> >> > >>>
> >> >> >
> >> >> > --
> >> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> >> >> > www.avast.com

Re: Component activemq not found

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

you have a requirement in your bundle: it's the Import-Service
statement. The problem comes from there: it's nothing about the
runtime.

I would recommend adding configuration to maven-bundle-plugin to not
put this requirement in your bundle MANIFEST.

I already answered similar questions on the Karaf mailing list several times.

By the way, this kind of question should be discussed on the Karaf
mailing list IMHO.

Regards
JB

On Tue, Aug 23, 2022 at 10:35 AM Ephemeris Lappis
<ep...@gmail.com> wrote:
>
> Hello again !
>
> Well, I'm not sure I understand what you mean about "requirements" in my bundle. I have no requirement in my manifest. Here the full copy of the manifest :
>
> Manifest-Version: 1.0
> Bnd-LastModified: 1661240801094
> Build-Jdk-Spec: 1.8
> Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
> Bundle-Description: Fifi-T26 :: Camel routes
> Bundle-ManifestVersion: 2
> Bundle-Name: Fifi-T26 :: Camel
> Bundle-SymbolicName: my-test-26-karaf-2-routes
> Bundle-Version: 0.0.1.SNAPSHOT
> Created-By: Apache Maven Bundle Plugin 5.1.8
> DynamicImport-Package: groovy.*,org.codehaus.groovy.*
> Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
>  )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
>  on="[1.0.0,2.0.0)"
> Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
>  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
>  ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
>  jndi.service.name=jdbc/fifi)
> Tool: Bnd-6.3.1.202206071316
>
> I aim to provide my bundle (and all similar bundles in our projects) as a feature, with dependencies that pull all the common features. For that I have created a global common feature, and for  every applicative bundle, this feature is referenced as a prerequisite. Here are the bundle feature and the common one :
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes">
>     <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
>     <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT">
>         <details>Fifi-T26 :: Camel routes - Configuration</details>
>         <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
>     </feature>
>     <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT">
>         <details>Fifi-T26 :: Camel routes</details>
>         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-x-feature</feature>
>         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>
>         <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
>     </feature>
> </features>
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf">
>     <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
>     <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT">
>         <details>Fifi-T26 :: Feature Definition</details>
>         <feature>transaction</feature>
>         <feature version="2.25.4">camel-spring</feature>
>         <feature version="2.25.4">camel-blueprint</feature>
>         <feature version="2.25.4">camel-groovy</feature>
>         <feature version="2.25.4">camel-csv</feature>
>         <feature version="2.25.4">camel-jms</feature>
>         <feature version="2.25.4">camel-sql</feature>
>         <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
>         <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
>     </feature>
> </features>
>
> The error happens when I try to install my bundle as a feature :
> repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
> feature:install my-test-26-karaf-2-routes
>
> All the dependent features and their bundles are installed and started as expected, and when my bundle is deployed, the missing jms service message appears, and the operation fails.
>
> org.apache.felix.resolver.reason.ReasonException: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"
>
> BUT when I install my bundle manually, it works : no missing service !
>
> bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT
>
> The referenced services (my custom ones, a data source and the jms connection factory) are all found without any problem, and my routes are started, and work as expected, including XA transactions...
>
> What's wrong when the bundle is deployed using its feature ? What is the difference between a raw bundle installing and doing the same using the feature ?
>
> Thanks again for your help.
>
> Regards.
>
>
> Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>>
>> Hi,
>>
>> That's not a problem of package but of OSGi requirement.
>>
>> You can do:
>> - do not include requirement in your my-test... bundle
>> - provide the capability in your feature (similar to
>> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)
>>
>> IMHO, the easiest way is to avoid requirement in your bundle (adding
>> this to the maven-bundle-plugin configuration).
>>
>> So, there's no problem with the packages, etc. The problem is simply
>> the requirement in your bundle (you can see in the MANIFEST of your
>> bundle, you will see a Require-Capability/Require-Service
>> instructions).
>>
>> Regards
>> JB
>>
>> See:
>>
>> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
>> <ep...@gmail.com> wrote:
>> >
>> > Hello again.
>> >
>> > As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
>> >
>> > In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
>> > karaf@root()> exports | grep javax.jms
>> > javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
>> > javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
>> >
>> > In my blueprints I've added the service reference, and used it on my JMS routes :
>> >  <reference
>> >     id="myJMS"
>> >     interface="javax.jms.ConnectionFactory"
>> >     availability="mandatory" />
>> >
>> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
>> >
>> > My bundle's manifest imports the correct package and service :
>> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
>> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
>> >  nt;version="[1.0.0,2.0.0)"
>> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
>> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
>> >  ry;multiple:=false
>> >
>> > The service seems to be present on Karaf :
>> >
>> > karaf@root()> jms:connectionfactories
>> > JMS Connection Factory
>> > ──────────────────────
>> > jms/my_amq
>> >
>> > and with service:list :
>> >
>> > [javax.jms.ConnectionFactory]
>> > -----------------------------
>> >  name = my_amq
>> >  osgi.jndi.service.name = jms/my_amq
>> >  password = secret
>> >  pax.jms.managed = true
>> >  service.bundleid = 93
>> >  service.factoryPid = org.ops4j.connectionfactory
>> >  service.id = 147
>> >  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
>> >  service.scope = singleton
>> >  type = activemq
>> >  url = tcp://localhost:61616
>> >  user = application
>> > Provided by :
>> >  OPS4J Pax JMS Config (93)
>> > Used by:
>> >  System Bundle (0)
>> >
>> > [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
>> >
>> > But when installing my feature, the services do not match, and I have the following error :( !!!
>> >
>> > Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
>> >
>> > I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
>> >
>> > Inspecting the ActiveMQ OSGi bundle :
>> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
>> >
>> > I saw that it also gets the class, but doesn't export it :
>> >
>> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
>> > javax/jms/ConnectionFactory.class | exported: false
>> >
>> > Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
>> >
>> > With previous versions of ActiveMQ I think it was working...
>> >
>> > Thanks a lot for your help.
>> >
>> > Regards.
>> >
>> >
>> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>> >>
>> >> Hi,
>> >>
>> >> here's the documentation about camel-activemq:
>> >> https://camel.apache.org/components/3.18.x/activemq-component.html
>> >>
>> >> About the ConnectionFactory, you have to define it as reference in
>> >> your route. You can find an example here:
>> >>
>> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
>> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
>> >>
>> >> Regards
>> >> JB
>> >>
>> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
>> >> <ep...@gmail.com> wrote:
>> >> >
>> >> > Hello.
>> >> >
>> >> > I've never seen any documentation about "camel-activeemq" : what's the
>> >> > feature that provides it ?
>> >> >
>> >> > As I've said before, I've been trying to use camel-jms but surprisingly
>> >> > my unique connection factory is not detected, and the component asks for
>> >> > an explicit declaration. I thought that one unique connection factory
>> >> > should be taken into account... I've created a unique connection factory
>> >> > using "jms:create" connecting to an external ActiveMQ, and I've checked
>> >> > that the service is present declaring the right interface. Is there a
>> >> > special way of declaring or naming the connexion factory to make it
>> >> > available for routes with camel-jms endpoints ?
>> >> >
>> >> > Thanks a lot for your help.
>> >> >
>> >> > Regards.
>> >> >
>> >> > Ephemeris Lappis
>> >> >
>> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
>> >> > > That's correct: activemq-camel has been removed.
>> >> > >
>> >> > > You can now use camel-jms (recommended) or camel-activeemq.
>> >> > >
>> >> > > You can wrap your own component if needed, but I would rather update
>> >> > > to camel-jms (not so hard to do).
>> >> > >
>> >> > > Regards
>> >> > > JB
>> >> > >
>> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
>> >> > > <ep...@gmail.com> wrote:
>> >> > >> Hello.
>> >> > >>
>> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
>> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
>> >> > >> I've decided to switch to ActiveMQ 5.17.1.
>> >> > >>
>> >> > >> Before, I think the component camel-activemq was provided by the feature
>> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
>> >> > >> if I'm not wrong...
>> >> > >>
>> >> > >> I've also tried as you suggested to use the jms component in my routes, but
>> >> > >> the connection factory I've created to connect to my ActiveMQ server is not
>> >> > >> taken into account by the component that requires an explicit connection
>> >> > >> factory... Changing all our about 100 camel projects to change from
>> >> > >> activemq to jms and declare a connection factory reference seems to be a
>> >> > >> very bad choice for us...
>> >> > >>
>> >> > >> So, from both sides I've issues.
>> >> > >>
>> >> > >> Any idea to get out of this sad situation 😥 ?
>> >> > >>
>> >> > >> Thanks a lot !
>> >> > >>
>> >> > >> Regards.
>> >> > >>
>> >> > >> PS: Perhaps the documentation on the component should say that it's
>> >> > >> available "Since Camel 1.0" but also only with restriction after a given
>> >> > >> version...
>> >> > >>
>> >> > >>
>> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
>> >> > >>
>> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
>> >> > >>> It comes from Apache ActiveMQ 5.x instead.
>> >> > >>>
>> >> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
>> >> > >>> JAR and its no longer available.
>> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
>> >> > >>>
>> >> > >>> In the Camel website make sure to browse the components list for the Camel
>> >> > >>> version you use. The list is different per version.
>> >> > >>>
>> >> > >>>
>> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
>> >> > >>> ephemeris.lappis@gmail.com> wrote:
>> >> > >>>
>> >> > >>>> Hello.
>> >> > >>>>
>> >> > >>>> I've already asked the question, but probably not clearly...
>> >> > >>>>
>> >> > >>>> I don't understand why I can't resolve the dependency for :
>> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
>> >> > >>>>
>> >> > >>>> I used this component for a long time on old servicemix environments,
>> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
>> >> > >>>> ActiveMQ 5.17.1).
>> >> > >>>>
>> >> > >>>> The component is still documented on the Camel components list, but I
>> >> > >>>> can't find it.
>> >> > >>>>
>> >> > >>>> Any help ?
>> >> > >>>>
>> >> > >>>> Thanks in advance.
>> >> > >>>>
>> >> > >>>> Regards.
>> >> > >>>>
>> >> > >>>
>> >> > >>> --
>> >> > >>> Claus Ibsen
>> >> > >>> -----------------
>> >> > >>> http://davsclaus.com @davsclaus
>> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
>> >> > >>>
>> >> >
>> >> > --
>> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
>> >> > www.avast.com

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello again.

Sorry to answer my last email once more...

As I was not very happy after my last test with the
"serviceRequirements=disable", and as I remembered that something is
kept in memory about features, I've cleaned up my Karaf and play the
same test again, and it seems to work fine now. My feature, after
removing its repository, and so on was not really refreshed, and some
requirement resolution was still applied...

This means that the problem comes from the resolver in the feature
installer that identifies the jms service but does not resolve the
requirement with the existing connection factory. It's strange that
this is failing for jms services, but not for my jdbc datasource that
seems to be found by the same resolver.

Now that I've disable the requirements in the Karaf configuration,
should I have other issues for standard features, or does it only
apply for my features ?

Is this configuration modification the only way to make my features
installable or can I apply something with a more specific scope ?

Thanks again for your help.

Regards.


Le mer. 24 août 2022 à 09:56, Ephemeris Lappis
<ep...@gmail.com> a écrit :
>
> Hello.
>
> Sorry to answer my own message...
>
> I think I have perhaps an explanation. Reading again the Karaf's
> features documentation, I noticed the part that explains how the
> resolver detects bundle requirements before installing a feature.
> Perhaps this is why it detects that my bundle needs a jms connection
> factory service, but something fails looking for existing services :
> both jms CF created by jms commands or with my own blueprint seem to
> be ignored by the feature resolver while they are both taken into
> account when installing the bundle directly.
>
> Here the part of the documentation :
>
> The feature resolver checks the service requirements, and installs the
> bundles providing the services matching the requirements. The default
> mode enables this behavior only for "new style" features repositories
> (basically, the features repositories XML with schema equal or greater
> to 1.3.0). It doesn’t apply for "old style" features repositories
> (coming from Karaf 2 or 3).
>
> As mentioned in the documentation, I've tried to disable the service resolving :
> serviceRequirements=disable
>
> But I have the same issue when I try to install my feature : the jms
> service is still not found :(
>
> An idea about this resolver and why it doesn't detect the existing services ???
>
> Thanks again and again ;)
>
> Regards.
>
>
> Le mar. 23 août 2022 à 10:35, Ephemeris Lappis
> <ep...@gmail.com> a écrit :
> >
> > Hello again !
> >
> > Well, I'm not sure I understand what you mean about "requirements" in my bundle. I have no requirement in my manifest. Here the full copy of the manifest :
> >
> > Manifest-Version: 1.0
> > Bnd-LastModified: 1661240801094
> > Build-Jdk-Spec: 1.8
> > Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
> > Bundle-Description: Fifi-T26 :: Camel routes
> > Bundle-ManifestVersion: 2
> > Bundle-Name: Fifi-T26 :: Camel
> > Bundle-SymbolicName: my-test-26-karaf-2-routes
> > Bundle-Version: 0.0.1.SNAPSHOT
> > Created-By: Apache Maven Bundle Plugin 5.1.8
> > DynamicImport-Package: groovy.*,org.codehaus.groovy.*
> > Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
> >  )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
> >  on="[1.0.0,2.0.0)"
> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> >  ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
> >  jndi.service.name=jdbc/fifi)
> > Tool: Bnd-6.3.1.202206071316
> >
> > I aim to provide my bundle (and all similar bundles in our projects) as a feature, with dependencies that pull all the common features. For that I have created a global common feature, and for  every applicative bundle, this feature is referenced as a prerequisite. Here are the bundle feature and the common one :
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes">
> >     <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
> >     <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT">
> >         <details>Fifi-T26 :: Camel routes - Configuration</details>
> >         <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
> >     </feature>
> >     <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT">
> >         <details>Fifi-T26 :: Camel routes</details>
> >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-x-feature</feature>
> >         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>
> >         <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
> >     </feature>
> > </features>
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf">
> >     <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
> >     <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT">
> >         <details>Fifi-T26 :: Feature Definition</details>
> >         <feature>transaction</feature>
> >         <feature version="2.25.4">camel-spring</feature>
> >         <feature version="2.25.4">camel-blueprint</feature>
> >         <feature version="2.25.4">camel-groovy</feature>
> >         <feature version="2.25.4">camel-csv</feature>
> >         <feature version="2.25.4">camel-jms</feature>
> >         <feature version="2.25.4">camel-sql</feature>
> >         <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
> >         <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
> >     </feature>
> > </features>
> >
> > The error happens when I try to install my bundle as a feature :
> > repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
> > feature:install my-test-26-karaf-2-routes
> >
> > All the dependent features and their bundles are installed and started as expected, and when my bundle is deployed, the missing jms service message appears, and the operation fails.
> >
> > org.apache.felix.resolver.reason.ReasonException: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"
> >
> > BUT when I install my bundle manually, it works : no missing service !
> >
> > bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT
> >
> > The referenced services (my custom ones, a data source and the jms connection factory) are all found without any problem, and my routes are started, and work as expected, including XA transactions...
> >
> > What's wrong when the bundle is deployed using its feature ? What is the difference between a raw bundle installing and doing the same using the feature ?
> >
> > Thanks again for your help.
> >
> > Regards.
> >
> >
> > Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> >>
> >> Hi,
> >>
> >> That's not a problem of package but of OSGi requirement.
> >>
> >> You can do:
> >> - do not include requirement in your my-test... bundle
> >> - provide the capability in your feature (similar to
> >> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)
> >>
> >> IMHO, the easiest way is to avoid requirement in your bundle (adding
> >> this to the maven-bundle-plugin configuration).
> >>
> >> So, there's no problem with the packages, etc. The problem is simply
> >> the requirement in your bundle (you can see in the MANIFEST of your
> >> bundle, you will see a Require-Capability/Require-Service
> >> instructions).
> >>
> >> Regards
> >> JB
> >>
> >> See:
> >>
> >> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
> >> <ep...@gmail.com> wrote:
> >> >
> >> > Hello again.
> >> >
> >> > As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
> >> >
> >> > In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
> >> > karaf@root()> exports | grep javax.jms
> >> > javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
> >> > javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
> >> >
> >> > In my blueprints I've added the service reference, and used it on my JMS routes :
> >> >  <reference
> >> >     id="myJMS"
> >> >     interface="javax.jms.ConnectionFactory"
> >> >     availability="mandatory" />
> >> >
> >> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
> >> >
> >> > My bundle's manifest imports the correct package and service :
> >> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
> >> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
> >> >  nt;version="[1.0.0,2.0.0)"
> >> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> >> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> >> >  ry;multiple:=false
> >> >
> >> > The service seems to be present on Karaf :
> >> >
> >> > karaf@root()> jms:connectionfactories
> >> > JMS Connection Factory
> >> > ──────────────────────
> >> > jms/my_amq
> >> >
> >> > and with service:list :
> >> >
> >> > [javax.jms.ConnectionFactory]
> >> > -----------------------------
> >> >  name = my_amq
> >> >  osgi.jndi.service.name = jms/my_amq
> >> >  password = secret
> >> >  pax.jms.managed = true
> >> >  service.bundleid = 93
> >> >  service.factoryPid = org.ops4j.connectionfactory
> >> >  service.id = 147
> >> >  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
> >> >  service.scope = singleton
> >> >  type = activemq
> >> >  url = tcp://localhost:61616
> >> >  user = application
> >> > Provided by :
> >> >  OPS4J Pax JMS Config (93)
> >> > Used by:
> >> >  System Bundle (0)
> >> >
> >> > [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
> >> >
> >> > But when installing my feature, the services do not match, and I have the following error :( !!!
> >> >
> >> > Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
> >> >
> >> > I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
> >> >
> >> > Inspecting the ActiveMQ OSGi bundle :
> >> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
> >> >
> >> > I saw that it also gets the class, but doesn't export it :
> >> >
> >> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
> >> > javax/jms/ConnectionFactory.class | exported: false
> >> >
> >> > Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
> >> >
> >> > With previous versions of ActiveMQ I think it was working...
> >> >
> >> > Thanks a lot for your help.
> >> >
> >> > Regards.
> >> >
> >> >
> >> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
> >> >>
> >> >> Hi,
> >> >>
> >> >> here's the documentation about camel-activemq:
> >> >> https://camel.apache.org/components/3.18.x/activemq-component.html
> >> >>
> >> >> About the ConnectionFactory, you have to define it as reference in
> >> >> your route. You can find an example here:
> >> >>
> >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> >> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> >> >>
> >> >> Regards
> >> >> JB
> >> >>
> >> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> >> >> <ep...@gmail.com> wrote:
> >> >> >
> >> >> > Hello.
> >> >> >
> >> >> > I've never seen any documentation about "camel-activeemq" : what's the
> >> >> > feature that provides it ?
> >> >> >
> >> >> > As I've said before, I've been trying to use camel-jms but surprisingly
> >> >> > my unique connection factory is not detected, and the component asks for
> >> >> > an explicit declaration. I thought that one unique connection factory
> >> >> > should be taken into account... I've created a unique connection factory
> >> >> > using "jms:create" connecting to an external ActiveMQ, and I've checked
> >> >> > that the service is present declaring the right interface. Is there a
> >> >> > special way of declaring or naming the connexion factory to make it
> >> >> > available for routes with camel-jms endpoints ?
> >> >> >
> >> >> > Thanks a lot for your help.
> >> >> >
> >> >> > Regards.
> >> >> >
> >> >> > Ephemeris Lappis
> >> >> >
> >> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> >> >> > > That's correct: activemq-camel has been removed.
> >> >> > >
> >> >> > > You can now use camel-jms (recommended) or camel-activeemq.
> >> >> > >
> >> >> > > You can wrap your own component if needed, but I would rather update
> >> >> > > to camel-jms (not so hard to do).
> >> >> > >
> >> >> > > Regards
> >> >> > > JB
> >> >> > >
> >> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> >> >> > > <ep...@gmail.com> wrote:
> >> >> > >> Hello.
> >> >> > >>
> >> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> >> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> >> >> > >> I've decided to switch to ActiveMQ 5.17.1.
> >> >> > >>
> >> >> > >> Before, I think the component camel-activemq was provided by the feature
> >> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> >> >> > >> if I'm not wrong...
> >> >> > >>
> >> >> > >> I've also tried as you suggested to use the jms component in my routes, but
> >> >> > >> the connection factory I've created to connect to my ActiveMQ server is not
> >> >> > >> taken into account by the component that requires an explicit connection
> >> >> > >> factory... Changing all our about 100 camel projects to change from
> >> >> > >> activemq to jms and declare a connection factory reference seems to be a
> >> >> > >> very bad choice for us...
> >> >> > >>
> >> >> > >> So, from both sides I've issues.
> >> >> > >>
> >> >> > >> Any idea to get out of this sad situation 😥 ?
> >> >> > >>
> >> >> > >> Thanks a lot !
> >> >> > >>
> >> >> > >> Regards.
> >> >> > >>
> >> >> > >> PS: Perhaps the documentation on the component should say that it's
> >> >> > >> available "Since Camel 1.0" but also only with restriction after a given
> >> >> > >> version...
> >> >> > >>
> >> >> > >>
> >> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
> >> >> > >>
> >> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> >> >> > >>> It comes from Apache ActiveMQ 5.x instead.
> >> >> > >>>
> >> >> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> >> >> > >>> JAR and its no longer available.
> >> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> >> >> > >>>
> >> >> > >>> In the Camel website make sure to browse the components list for the Camel
> >> >> > >>> version you use. The list is different per version.
> >> >> > >>>
> >> >> > >>>
> >> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> >> >> > >>> ephemeris.lappis@gmail.com> wrote:
> >> >> > >>>
> >> >> > >>>> Hello.
> >> >> > >>>>
> >> >> > >>>> I've already asked the question, but probably not clearly...
> >> >> > >>>>
> >> >> > >>>> I don't understand why I can't resolve the dependency for :
> >> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> >> >> > >>>>
> >> >> > >>>> I used this component for a long time on old servicemix environments,
> >> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> >> >> > >>>> ActiveMQ 5.17.1).
> >> >> > >>>>
> >> >> > >>>> The component is still documented on the Camel components list, but I
> >> >> > >>>> can't find it.
> >> >> > >>>>
> >> >> > >>>> Any help ?
> >> >> > >>>>
> >> >> > >>>> Thanks in advance.
> >> >> > >>>>
> >> >> > >>>> Regards.
> >> >> > >>>>
> >> >> > >>>
> >> >> > >>> --
> >> >> > >>> Claus Ibsen
> >> >> > >>> -----------------
> >> >> > >>> http://davsclaus.com @davsclaus
> >> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> >> >> > >>>
> >> >> >
> >> >> > --
> >> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> >> >> > www.avast.com

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

Sorry to answer my own message...

I think I have perhaps an explanation. Reading again the Karaf's
features documentation, I noticed the part that explains how the
resolver detects bundle requirements before installing a feature.
Perhaps this is why it detects that my bundle needs a jms connection
factory service, but something fails looking for existing services :
both jms CF created by jms commands or with my own blueprint seem to
be ignored by the feature resolver while they are both taken into
account when installing the bundle directly.

Here the part of the documentation :

The feature resolver checks the service requirements, and installs the
bundles providing the services matching the requirements. The default
mode enables this behavior only for "new style" features repositories
(basically, the features repositories XML with schema equal or greater
to 1.3.0). It doesn’t apply for "old style" features repositories
(coming from Karaf 2 or 3).

As mentioned in the documentation, I've tried to disable the service resolving :
serviceRequirements=disable

But I have the same issue when I try to install my feature : the jms
service is still not found :(

An idea about this resolver and why it doesn't detect the existing services ???

Thanks again and again ;)

Regards.


Le mar. 23 août 2022 à 10:35, Ephemeris Lappis
<ep...@gmail.com> a écrit :
>
> Hello again !
>
> Well, I'm not sure I understand what you mean about "requirements" in my bundle. I have no requirement in my manifest. Here the full copy of the manifest :
>
> Manifest-Version: 1.0
> Bnd-LastModified: 1661240801094
> Build-Jdk-Spec: 1.8
> Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
> Bundle-Description: Fifi-T26 :: Camel routes
> Bundle-ManifestVersion: 2
> Bundle-Name: Fifi-T26 :: Camel
> Bundle-SymbolicName: my-test-26-karaf-2-routes
> Bundle-Version: 0.0.1.SNAPSHOT
> Created-By: Apache Maven Bundle Plugin 5.1.8
> DynamicImport-Package: groovy.*,org.codehaus.groovy.*
> Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
>  )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
>  on="[1.0.0,2.0.0)"
> Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
>  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
>  ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
>  jndi.service.name=jdbc/fifi)
> Tool: Bnd-6.3.1.202206071316
>
> I aim to provide my bundle (and all similar bundles in our projects) as a feature, with dependencies that pull all the common features. For that I have created a global common feature, and for  every applicative bundle, this feature is referenced as a prerequisite. Here are the bundle feature and the common one :
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf-2-routes">
>     <repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
>     <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 :: Camel routes - Configuration" version="0.0.1.SNAPSHOT">
>         <details>Fifi-T26 :: Camel routes - Configuration</details>
>         <configfile finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
>     </feature>
>     <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 :: Camel" version="0.0.1.SNAPSHOT">
>         <details>Fifi-T26 :: Camel routes</details>
>         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-x-feature</feature>
>         <feature version="0.0.1-SNAPSHOT" prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>
>         <bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
>     </feature>
> </features>
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="my-test-26-karaf">
>     <repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
>     <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 :: Feature" version="0.0.1.SNAPSHOT">
>         <details>Fifi-T26 :: Feature Definition</details>
>         <feature>transaction</feature>
>         <feature version="2.25.4">camel-spring</feature>
>         <feature version="2.25.4">camel-blueprint</feature>
>         <feature version="2.25.4">camel-groovy</feature>
>         <feature version="2.25.4">camel-csv</feature>
>         <feature version="2.25.4">camel-jms</feature>
>         <feature version="2.25.4">camel-sql</feature>
>         <bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
>         <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
>     </feature>
> </features>
>
> The error happens when I try to install my bundle as a feature :
> repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
> feature:install my-test-26-karaf-2-routes
>
> All the dependent features and their bundles are installed and started as expected, and when my bundle is deployed, the missing jms service message appears, and the operation fails.
>
> org.apache.felix.resolver.reason.ReasonException: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"
>
> BUT when I install my bundle manually, it works : no missing service !
>
> bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT
>
> The referenced services (my custom ones, a data source and the jms connection factory) are all found without any problem, and my routes are started, and work as expected, including XA transactions...
>
> What's wrong when the bundle is deployed using its feature ? What is the difference between a raw bundle installing and doing the same using the feature ?
>
> Thanks again for your help.
>
> Regards.
>
>
> Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>>
>> Hi,
>>
>> That's not a problem of package but of OSGi requirement.
>>
>> You can do:
>> - do not include requirement in your my-test... bundle
>> - provide the capability in your feature (similar to
>> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)
>>
>> IMHO, the easiest way is to avoid requirement in your bundle (adding
>> this to the maven-bundle-plugin configuration).
>>
>> So, there's no problem with the packages, etc. The problem is simply
>> the requirement in your bundle (you can see in the MANIFEST of your
>> bundle, you will see a Require-Capability/Require-Service
>> instructions).
>>
>> Regards
>> JB
>>
>> See:
>>
>> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
>> <ep...@gmail.com> wrote:
>> >
>> > Hello again.
>> >
>> > As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
>> >
>> > In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
>> > karaf@root()> exports | grep javax.jms
>> > javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
>> > javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
>> >
>> > In my blueprints I've added the service reference, and used it on my JMS routes :
>> >  <reference
>> >     id="myJMS"
>> >     interface="javax.jms.ConnectionFactory"
>> >     availability="mandatory" />
>> >
>> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
>> >
>> > My bundle's manifest imports the correct package and service :
>> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
>> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
>> >  nt;version="[1.0.0,2.0.0)"
>> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
>> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
>> >  ry;multiple:=false
>> >
>> > The service seems to be present on Karaf :
>> >
>> > karaf@root()> jms:connectionfactories
>> > JMS Connection Factory
>> > ──────────────────────
>> > jms/my_amq
>> >
>> > and with service:list :
>> >
>> > [javax.jms.ConnectionFactory]
>> > -----------------------------
>> >  name = my_amq
>> >  osgi.jndi.service.name = jms/my_amq
>> >  password = secret
>> >  pax.jms.managed = true
>> >  service.bundleid = 93
>> >  service.factoryPid = org.ops4j.connectionfactory
>> >  service.id = 147
>> >  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
>> >  service.scope = singleton
>> >  type = activemq
>> >  url = tcp://localhost:61616
>> >  user = application
>> > Provided by :
>> >  OPS4J Pax JMS Config (93)
>> > Used by:
>> >  System Bundle (0)
>> >
>> > [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
>> >
>> > But when installing my feature, the services do not match, and I have the following error :( !!!
>> >
>> > Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
>> >
>> > I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
>> >
>> > Inspecting the ActiveMQ OSGi bundle :
>> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
>> >
>> > I saw that it also gets the class, but doesn't export it :
>> >
>> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
>> > javax/jms/ConnectionFactory.class | exported: false
>> >
>> > Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
>> >
>> > With previous versions of ActiveMQ I think it was working...
>> >
>> > Thanks a lot for your help.
>> >
>> > Regards.
>> >
>> >
>> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>> >>
>> >> Hi,
>> >>
>> >> here's the documentation about camel-activemq:
>> >> https://camel.apache.org/components/3.18.x/activemq-component.html
>> >>
>> >> About the ConnectionFactory, you have to define it as reference in
>> >> your route. You can find an example here:
>> >>
>> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
>> >> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
>> >>
>> >> Regards
>> >> JB
>> >>
>> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
>> >> <ep...@gmail.com> wrote:
>> >> >
>> >> > Hello.
>> >> >
>> >> > I've never seen any documentation about "camel-activeemq" : what's the
>> >> > feature that provides it ?
>> >> >
>> >> > As I've said before, I've been trying to use camel-jms but surprisingly
>> >> > my unique connection factory is not detected, and the component asks for
>> >> > an explicit declaration. I thought that one unique connection factory
>> >> > should be taken into account... I've created a unique connection factory
>> >> > using "jms:create" connecting to an external ActiveMQ, and I've checked
>> >> > that the service is present declaring the right interface. Is there a
>> >> > special way of declaring or naming the connexion factory to make it
>> >> > available for routes with camel-jms endpoints ?
>> >> >
>> >> > Thanks a lot for your help.
>> >> >
>> >> > Regards.
>> >> >
>> >> > Ephemeris Lappis
>> >> >
>> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
>> >> > > That's correct: activemq-camel has been removed.
>> >> > >
>> >> > > You can now use camel-jms (recommended) or camel-activeemq.
>> >> > >
>> >> > > You can wrap your own component if needed, but I would rather update
>> >> > > to camel-jms (not so hard to do).
>> >> > >
>> >> > > Regards
>> >> > > JB
>> >> > >
>> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
>> >> > > <ep...@gmail.com> wrote:
>> >> > >> Hello.
>> >> > >>
>> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
>> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
>> >> > >> I've decided to switch to ActiveMQ 5.17.1.
>> >> > >>
>> >> > >> Before, I think the component camel-activemq was provided by the feature
>> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
>> >> > >> if I'm not wrong...
>> >> > >>
>> >> > >> I've also tried as you suggested to use the jms component in my routes, but
>> >> > >> the connection factory I've created to connect to my ActiveMQ server is not
>> >> > >> taken into account by the component that requires an explicit connection
>> >> > >> factory... Changing all our about 100 camel projects to change from
>> >> > >> activemq to jms and declare a connection factory reference seems to be a
>> >> > >> very bad choice for us...
>> >> > >>
>> >> > >> So, from both sides I've issues.
>> >> > >>
>> >> > >> Any idea to get out of this sad situation 😥 ?
>> >> > >>
>> >> > >> Thanks a lot !
>> >> > >>
>> >> > >> Regards.
>> >> > >>
>> >> > >> PS: Perhaps the documentation on the component should say that it's
>> >> > >> available "Since Camel 1.0" but also only with restriction after a given
>> >> > >> version...
>> >> > >>
>> >> > >>
>> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
>> >> > >>
>> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
>> >> > >>> It comes from Apache ActiveMQ 5.x instead.
>> >> > >>>
>> >> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
>> >> > >>> JAR and its no longer available.
>> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
>> >> > >>>
>> >> > >>> In the Camel website make sure to browse the components list for the Camel
>> >> > >>> version you use. The list is different per version.
>> >> > >>>
>> >> > >>>
>> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
>> >> > >>> ephemeris.lappis@gmail.com> wrote:
>> >> > >>>
>> >> > >>>> Hello.
>> >> > >>>>
>> >> > >>>> I've already asked the question, but probably not clearly...
>> >> > >>>>
>> >> > >>>> I don't understand why I can't resolve the dependency for :
>> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
>> >> > >>>>
>> >> > >>>> I used this component for a long time on old servicemix environments,
>> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
>> >> > >>>> ActiveMQ 5.17.1).
>> >> > >>>>
>> >> > >>>> The component is still documented on the Camel components list, but I
>> >> > >>>> can't find it.
>> >> > >>>>
>> >> > >>>> Any help ?
>> >> > >>>>
>> >> > >>>> Thanks in advance.
>> >> > >>>>
>> >> > >>>> Regards.
>> >> > >>>>
>> >> > >>>
>> >> > >>> --
>> >> > >>> Claus Ibsen
>> >> > >>> -----------------
>> >> > >>> http://davsclaus.com @davsclaus
>> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
>> >> > >>>
>> >> >
>> >> > --
>> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
>> >> > www.avast.com

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello again !

Well, I'm not sure I understand what you mean about "requirements" in my
bundle. I have no requirement in my manifest. Here the full copy of the
manifest :

Manifest-Version: 1.0
Bnd-LastModified: 1661240801094
Build-Jdk-Spec: 1.8
Bundle-Blueprint: OSGI-INF/blueprint/routes.xml
Bundle-Description: Fifi-T26 :: Camel routes
Bundle-ManifestVersion: 2
Bundle-Name: Fifi-T26 :: Camel
Bundle-SymbolicName: my-test-26-karaf-2-routes
Bundle-Version: 0.0.1.SNAPSHOT
Created-By: Apache Maven Bundle Plugin 5.1.8
DynamicImport-Package: groovy.*,org.codehaus.groovy.*
Import-Package: javax.jms,javax.sql,my.test.t26.helper;version="[0.0,1
 )",my.test.t26.uow;version="[0.0,1)",org.osgi.service.blueprint;versi
 on="[1.0.0,2.0.0)"
Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
 6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
 ry;multiple:=false,javax.sql.DataSource;multiple:=false;filter=(osgi.
 jndi.service.name=jdbc/fifi)
Tool: Bnd-6.3.1.202206071316

I aim to provide my bundle (and all similar bundles in our projects) as a
feature, with dependencies that pull all the common features. For that I
have created a global common feature, and for  every applicative bundle,
this feature is referenced as a prerequisite. Here are the bundle feature
and the common one :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
name="my-test-26-karaf-2-routes">

<repository>mvn:my.tests/my-test-26-karaf-x-feature/0.0.1-SNAPSHOT/xml/features</repository>
    <feature name="my-test-26-karaf-2-routes-cfg" description="Fifi-T26 ::
Camel routes - Configuration" version="0.0.1.SNAPSHOT">
        <details>Fifi-T26 :: Camel routes - Configuration</details>
        <configfile
finalname="/etc/my_test_26_karaf_2_routes.cfg">mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/cfg/configuration</configfile>
    </feature>
    <feature name="my-test-26-karaf-2-routes" description="Fifi-T26 ::
Camel" version="0.0.1.SNAPSHOT">
        <details>Fifi-T26 :: Camel routes</details>
        <feature version="0.0.1-SNAPSHOT"
prerequisite="true">my-test-26-karaf-x-feature</feature>
        <feature version="0.0.1-SNAPSHOT"
prerequisite="true">my-test-26-karaf-2-routes-cfg</feature>

<bundle>mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT</bundle>
    </feature>
</features>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
name="my-test-26-karaf">

<repository>mvn:org.apache.camel.karaf/apache-camel/2.25.4/xml/features</repository>
    <feature name="my-test-26-karaf-x-feature" description="Fifi-T26 ::
Feature" version="0.0.1.SNAPSHOT">
        <details>Fifi-T26 :: Feature Definition</details>
        <feature>transaction</feature>
        <feature version="2.25.4">camel-spring</feature>
        <feature version="2.25.4">camel-blueprint</feature>
        <feature version="2.25.4">camel-groovy</feature>
        <feature version="2.25.4">camel-csv</feature>
        <feature version="2.25.4">camel-jms</feature>
        <feature version="2.25.4">camel-sql</feature>

<bundle>mvn:my.tests/my-test-26-karaf-1-service/0.0.1-SNAPSHOT</bundle>
        <bundle>mvn:my.tests/my-test-26-karaf-1-api/0.0.1-SNAPSHOT</bundle>
    </feature>
</features>

The error happens when I try to install my bundle as a feature :
repo-add mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT/XML/features
feature:install my-test-26-karaf-2-routes

All the dependent features and their bundles are installed and started as
expected, and when my bundle is deployed, the missing jms service message
appears, and the operation fails.

org.apache.felix.resolver.reason.ReasonException: Unable to resolve
my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement
[my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active;
filter:="(objectClass=javax.jms.ConnectionFactory)"

BUT when I install my bundle manually, it works : no missing service !

bundle:install -s mvn:my.tests/my-test-26-karaf-2-routes/0.0.1-SNAPSHOT

The referenced services (my custom ones, a data source and the jms
connection factory) are all found without any problem, and my routes are
started, and work as expected, including XA transactions...

What's wrong when the bundle is deployed using its feature ? What is the
difference between a raw bundle installing and doing the same using the
feature ?

Thanks again for your help.

Regards.


Le mar. 23 août 2022 à 07:09, Jean-Baptiste Onofré <jb...@nanthrax.net> a
écrit :

> Hi,
>
> That's not a problem of package but of OSGi requirement.
>
> You can do:
> - do not include requirement in your my-test... bundle
> - provide the capability in your feature (similar to
>
> https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28
> )
>
> IMHO, the easiest way is to avoid requirement in your bundle (adding
> this to the maven-bundle-plugin configuration).
>
> So, there's no problem with the packages, etc. The problem is simply
> the requirement in your bundle (you can see in the MANIFEST of your
> bundle, you will see a Require-Capability/Require-Service
> instructions).
>
> Regards
> JB
>
> See:
>
> On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
> <ep...@gmail.com> wrote:
> >
> > Hello again.
> >
> > As it seems I have no solution to get an implicit connection factory,
> I've adapted my POC setting myself a reference. But it seems that it
> doesn't work because the service that is created by the jms:create command
> doesn't match some class definition.
> >
> > In my POC's code I've added a dependency javax.jms-api version 2.0 to
> match the API version that the bundle that is deployed is providing.
> > karaf@root()> exports | grep javax.jms
> > javax.jms.doc-files                                    │ 2.0.0       │
> 83  │ javax.jms-api
> > javax.jms                                              │ 2.0.0       │
> 83  │ javax.jms-api
> >
> > In my blueprints I've added the service reference, and used it on my JMS
> routes :
> >  <reference
> >     id="myJMS"
> >     interface="javax.jms.ConnectionFactory"
> >     availability="mandatory" />
> >
> > <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
> >
> > My bundle's manifest imports the correct package and service :
> > Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
> >  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
> >  nt;version="[1.0.0,2.0.0)"
> > Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
> >  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
> >  ry;multiple:=false
> >
> > The service seems to be present on Karaf :
> >
> > karaf@root()> jms:connectionfactories
> > JMS Connection Factory
> > ──────────────────────
> > jms/my_amq
> >
> > and with service:list :
> >
> > [javax.jms.ConnectionFactory]
> > -----------------------------
> >  name = my_amq
> >  osgi.jndi.service.name = jms/my_amq
> >  password = secret
> >  pax.jms.managed = true
> >  service.bundleid = 93
> >  service.factoryPid = org.ops4j.connectionfactory
> >  service.id = 147
> >  service.pid =
> org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
> >  service.scope = singleton
> >  type = activemq
> >  url = tcp://localhost:61616
> >  user = application
> > Provided by :
> >  OPS4J Pax JMS Config (93)
> > Used by:
> >  System Bundle (0)
> >
> > [javax.management.MBeanRegistration,
> org.apache.karaf.features.management.FeaturesServiceMBean,
> javax.management.NotificationEmitter,
> javax.management.NotificationBroadcaster, javax.management.DynamicMBean,
> javax.management.MBeanRegistration]
> >
> > But when installing my feature, the services do not match, and I have
> the following error :( !!!
> >
> > Unable to resolve root: missing requirement [root] osgi.identity;
> osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature;
> version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]";
> filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))"
> [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT:
> missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT]
> osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle;
> version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused
> by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing
> requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service;
> effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
> >
> > I thought it may come from the class origin, but only one bundle seems
> to export it. So I tried to find the issue elsewhere...
> >
> > Inspecting the ActiveMQ OSGi bundle :
> >  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
> >
> > I saw that it also gets the class, but doesn't export it :
> >
> > karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
> > javax/jms/ConnectionFactory.class | exported: false
> >
> > Can I deduce that the JMS connection factory service may have been
> created using a bad class from a private package, and this may be the
> reason why it doesn't match my reference, and perhaps why the camel-jms
> component doesn't detect it ?
> >
> > With previous versions of ActiveMQ I think it was working...
> >
> > Thanks a lot for your help.
> >
> > Regards.
> >
> >
> > Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a
> écrit :
> >>
> >> Hi,
> >>
> >> here's the documentation about camel-activemq:
> >> https://camel.apache.org/components/3.18.x/activemq-component.html
> >>
> >> About the ConnectionFactory, you have to define it as reference in
> >> your route. You can find an example here:
> >>
> >>
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
> >>
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
> >>
> >> Regards
> >> JB
> >>
> >> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> >> <ep...@gmail.com> wrote:
> >> >
> >> > Hello.
> >> >
> >> > I've never seen any documentation about "camel-activeemq" : what's the
> >> > feature that provides it ?
> >> >
> >> > As I've said before, I've been trying to use camel-jms but
> surprisingly
> >> > my unique connection factory is not detected, and the component asks
> for
> >> > an explicit declaration. I thought that one unique connection factory
> >> > should be taken into account... I've created a unique connection
> factory
> >> > using "jms:create" connecting to an external ActiveMQ, and I've
> checked
> >> > that the service is present declaring the right interface. Is there a
> >> > special way of declaring or naming the connexion factory to make it
> >> > available for routes with camel-jms endpoints ?
> >> >
> >> > Thanks a lot for your help.
> >> >
> >> > Regards.
> >> >
> >> > Ephemeris Lappis
> >> >
> >> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> >> > > That's correct: activemq-camel has been removed.
> >> > >
> >> > > You can now use camel-jms (recommended) or camel-activeemq.
> >> > >
> >> > > You can wrap your own component if needed, but I would rather update
> >> > > to camel-jms (not so hard to do).
> >> > >
> >> > > Regards
> >> > > JB
> >> > >
> >> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> >> > > <ep...@gmail.com> wrote:
> >> > >> Hello.
> >> > >>
> >> > >> I've been working before on ActiveMQ 5.16.5, but as this version
> leads to
> >> > >> too many problems on Karaf 4.4.1 (spring compatibility among other
> issues),
> >> > >> I've decided to switch to ActiveMQ 5.17.1.
> >> > >>
> >> > >> Before, I think the component camel-activemq was provided by the
> feature
> >> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this
> feature,
> >> > >> if I'm not wrong...
> >> > >>
> >> > >> I've also tried as you suggested to use the jms component in my
> routes, but
> >> > >> the connection factory I've created to connect to my ActiveMQ
> server is not
> >> > >> taken into account by the component that requires an explicit
> connection
> >> > >> factory... Changing all our about 100 camel projects to change from
> >> > >> activemq to jms and declare a connection factory reference seems
> to be a
> >> > >> very bad choice for us...
> >> > >>
> >> > >> So, from both sides I've issues.
> >> > >>
> >> > >> Any idea to get out of this sad situation 😥 ?
> >> > >>
> >> > >> Thanks a lot !
> >> > >>
> >> > >> Regards.
> >> > >>
> >> > >> PS: Perhaps the documentation on the component should say that it's
> >> > >> available "Since Camel 1.0" but also only with restriction after a
> given
> >> > >> version...
> >> > >>
> >> > >>
> >> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com>
> a écrit :
> >> > >>
> >> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> >> > >>> It comes from Apache ActiveMQ 5.x instead.
> >> > >>>
> >> > >>> However starting from ActiveMQ 5.17 then they dropped their
> camel-activemq
> >> > >>> JAR and its no longer available.
> >> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ
> 5.16.x
> >> > >>>
> >> > >>> In the Camel website make sure to browse the components list for
> the Camel
> >> > >>> version you use. The list is different per version.
> >> > >>>
> >> > >>>
> >> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> >> > >>> ephemeris.lappis@gmail.com> wrote:
> >> > >>>
> >> > >>>> Hello.
> >> > >>>>
> >> > >>>> I've already asked the question, but probably not clearly...
> >> > >>>>
> >> > >>>> I don't understand why I can't resolve the dependency for :
> >> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> >> > >>>>
> >> > >>>> I used this component for a long time on old servicemix
> environments,
> >> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4
> (and
> >> > >>>> ActiveMQ 5.17.1).
> >> > >>>>
> >> > >>>> The component is still documented on the Camel components list,
> but I
> >> > >>>> can't find it.
> >> > >>>>
> >> > >>>> Any help ?
> >> > >>>>
> >> > >>>> Thanks in advance.
> >> > >>>>
> >> > >>>> Regards.
> >> > >>>>
> >> > >>>
> >> > >>> --
> >> > >>> Claus Ibsen
> >> > >>> -----------------
> >> > >>> http://davsclaus.com @davsclaus
> >> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> >> > >>>
> >> >
> >> > --
> >> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> >> > www.avast.com
>

Re: Component activemq not found

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

That's not a problem of package but of OSGi requirement.

You can do:
- do not include requirement in your my-test... bundle
- provide the capability in your feature (similar to
https://github.com/apache/karaf/blob/main/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml#L28)

IMHO, the easiest way is to avoid requirement in your bundle (adding
this to the maven-bundle-plugin configuration).

So, there's no problem with the packages, etc. The problem is simply
the requirement in your bundle (you can see in the MANIFEST of your
bundle, you will see a Require-Capability/Require-Service
instructions).

Regards
JB

See:

On Mon, Aug 22, 2022 at 12:23 PM Ephemeris Lappis
<ep...@gmail.com> wrote:
>
> Hello again.
>
> As it seems I have no solution to get an implicit connection factory, I've adapted my POC setting myself a reference. But it seems that it doesn't work because the service that is created by the jms:create command doesn't match some class definition.
>
> In my POC's code I've added a dependency javax.jms-api version 2.0 to match the API version that the bundle that is deployed is providing.
> karaf@root()> exports | grep javax.jms
> javax.jms.doc-files                                    │ 2.0.0       │ 83  │ javax.jms-api
> javax.jms                                              │ 2.0.0       │ 83  │ javax.jms-api
>
> In my blueprints I've added the service reference, and used it on my JMS routes :
>  <reference
>     id="myJMS"
>     interface="javax.jms.ConnectionFactory"
>     availability="mandatory" />
>
> <from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />
>
> My bundle's manifest imports the correct package and service :
> Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
>  ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
>  nt;version="[1.0.0,2.0.0)"
> Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
>  6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
>  ry;multiple:=false
>
> The service seems to be present on Karaf :
>
> karaf@root()> jms:connectionfactories
> JMS Connection Factory
> ──────────────────────
> jms/my_amq
>
> and with service:list :
>
> [javax.jms.ConnectionFactory]
> -----------------------------
>  name = my_amq
>  osgi.jndi.service.name = jms/my_amq
>  password = secret
>  pax.jms.managed = true
>  service.bundleid = 93
>  service.factoryPid = org.ops4j.connectionfactory
>  service.id = 147
>  service.pid = org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
>  service.scope = singleton
>  type = activemq
>  url = tcp://localhost:61616
>  user = application
> Provided by :
>  OPS4J Pax JMS Config (93)
> Used by:
>  System Bundle (0)
>
> [javax.management.MBeanRegistration, org.apache.karaf.features.management.FeaturesServiceMBean, javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, javax.management.DynamicMBean, javax.management.MBeanRegistration]
>
> But when installing my feature, the services do not match, and I have the following error :( !!!
>
> Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]
>
> I thought it may come from the class origin, but only one bundle seems to export it. So I tried to find the issue elsewhere...
>
> Inspecting the ActiveMQ OSGi bundle :
>  52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle
>
> I saw that it also gets the class, but doesn't export it :
>
> karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
> javax/jms/ConnectionFactory.class | exported: false
>
> Can I deduce that the JMS connection factory service may have been created using a bad class from a private package, and this may be the reason why it doesn't match my reference, and perhaps why the camel-jms component doesn't detect it ?
>
> With previous versions of ActiveMQ I think it was working...
>
> Thanks a lot for your help.
>
> Regards.
>
>
> Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a écrit :
>>
>> Hi,
>>
>> here's the documentation about camel-activemq:
>> https://camel.apache.org/components/3.18.x/activemq-component.html
>>
>> About the ConnectionFactory, you have to define it as reference in
>> your route. You can find an example here:
>>
>> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
>> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
>>
>> Regards
>> JB
>>
>> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
>> <ep...@gmail.com> wrote:
>> >
>> > Hello.
>> >
>> > I've never seen any documentation about "camel-activeemq" : what's the
>> > feature that provides it ?
>> >
>> > As I've said before, I've been trying to use camel-jms but surprisingly
>> > my unique connection factory is not detected, and the component asks for
>> > an explicit declaration. I thought that one unique connection factory
>> > should be taken into account... I've created a unique connection factory
>> > using "jms:create" connecting to an external ActiveMQ, and I've checked
>> > that the service is present declaring the right interface. Is there a
>> > special way of declaring or naming the connexion factory to make it
>> > available for routes with camel-jms endpoints ?
>> >
>> > Thanks a lot for your help.
>> >
>> > Regards.
>> >
>> > Ephemeris Lappis
>> >
>> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
>> > > That's correct: activemq-camel has been removed.
>> > >
>> > > You can now use camel-jms (recommended) or camel-activeemq.
>> > >
>> > > You can wrap your own component if needed, but I would rather update
>> > > to camel-jms (not so hard to do).
>> > >
>> > > Regards
>> > > JB
>> > >
>> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
>> > > <ep...@gmail.com> wrote:
>> > >> Hello.
>> > >>
>> > >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
>> > >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
>> > >> I've decided to switch to ActiveMQ 5.17.1.
>> > >>
>> > >> Before, I think the component camel-activemq was provided by the feature
>> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
>> > >> if I'm not wrong...
>> > >>
>> > >> I've also tried as you suggested to use the jms component in my routes, but
>> > >> the connection factory I've created to connect to my ActiveMQ server is not
>> > >> taken into account by the component that requires an explicit connection
>> > >> factory... Changing all our about 100 camel projects to change from
>> > >> activemq to jms and declare a connection factory reference seems to be a
>> > >> very bad choice for us...
>> > >>
>> > >> So, from both sides I've issues.
>> > >>
>> > >> Any idea to get out of this sad situation 😥 ?
>> > >>
>> > >> Thanks a lot !
>> > >>
>> > >> Regards.
>> > >>
>> > >> PS: Perhaps the documentation on the component should say that it's
>> > >> available "Since Camel 1.0" but also only with restriction after a given
>> > >> version...
>> > >>
>> > >>
>> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
>> > >>
>> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
>> > >>> It comes from Apache ActiveMQ 5.x instead.
>> > >>>
>> > >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
>> > >>> JAR and its no longer available.
>> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
>> > >>>
>> > >>> In the Camel website make sure to browse the components list for the Camel
>> > >>> version you use. The list is different per version.
>> > >>>
>> > >>>
>> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
>> > >>> ephemeris.lappis@gmail.com> wrote:
>> > >>>
>> > >>>> Hello.
>> > >>>>
>> > >>>> I've already asked the question, but probably not clearly...
>> > >>>>
>> > >>>> I don't understand why I can't resolve the dependency for :
>> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
>> > >>>>
>> > >>>> I used this component for a long time on old servicemix environments,
>> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
>> > >>>> ActiveMQ 5.17.1).
>> > >>>>
>> > >>>> The component is still documented on the Camel components list, but I
>> > >>>> can't find it.
>> > >>>>
>> > >>>> Any help ?
>> > >>>>
>> > >>>> Thanks in advance.
>> > >>>>
>> > >>>> Regards.
>> > >>>>
>> > >>>
>> > >>> --
>> > >>> Claus Ibsen
>> > >>> -----------------
>> > >>> http://davsclaus.com @davsclaus
>> > >>> Camel in Action 2: https://www.manning.com/ibsen2
>> > >>>
>> >
>> > --
>> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
>> > www.avast.com

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello again.

As it seems I have no solution to get an implicit connection factory, I've
adapted my POC setting myself a reference. But it seems that it doesn't
work because the service that is created by the jms:create command doesn't
match some class definition.

In my POC's code I've added a dependency javax.jms-api version 2.0 to match
the API version that the bundle that is deployed is providing.
karaf@root()> exports | grep javax.jms
javax.jms.doc-files                                    │ 2.0.0       │ 83
 │ javax.jms-api
javax.jms                                              │ 2.0.0       │ 83
 │ javax.jms-api

In my blueprints I've added the service reference, and used it on my JMS
routes :
 <reference
    id="myJMS"
    interface="javax.jms.ConnectionFactory"
    availability="mandatory" />

<from uri="jms:queue:k1-test-queue-1?connectionFactory=#myJMS" />

My bundle's manifest imports the correct package and service :
Import-Package: javax.jms;version="[2.0,3)",my.test.t26.helper;version
 ="[0.0,1)",my.test.t26.uow;version="[0.0,1)",org.osgi.service.bluepri
 nt;version="[1.0.0,2.0.0)"
Import-Service: javax.jms.ConnectionFactory;multiple:=false,my.test.t2
 6.helper.Helper;multiple:=false,my.test.t26.uow.CustomUnitOfWorkFacto
 ry;multiple:=false

The service seems to be present on Karaf :

karaf@root()> jms:connectionfactories
JMS Connection Factory
──────────────────────
jms/my_amq

and with service:list :

[javax.jms.ConnectionFactory]
-----------------------------
 name = my_amq
 osgi.jndi.service.name = jms/my_amq
 password = secret
 pax.jms.managed = true
 service.bundleid = 93
 service.factoryPid = org.ops4j.connectionfactory
 service.id = 147
 service.pid =
org.ops4j.connectionfactory.4d276d00-2c50-49b0-93f9-18dc16a107ce
 service.scope = singleton
 type = activemq
 url = tcp://localhost:61616
 user = application
Provided by :
 OPS4J Pax JMS Config (93)
Used by:
 System Bundle (0)

[javax.management.MBeanRegistration,
org.apache.karaf.features.management.FeaturesServiceMBean,
javax.management.NotificationEmitter,
javax.management.NotificationBroadcaster, javax.management.DynamicMBean,
javax.management.MBeanRegistration]

But when installing my feature, the services do not match, and I have the
following error :( !!!

Unable to resolve root: missing requirement [root] osgi.identity;
osgi.identity=my-test-26-karaf-2-routes; type=karaf.feature;
version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]";
filter:="(&(osgi.identity=my-test-26-karaf-2-routes)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))"
[caused by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT:
missing requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT]
osgi.identity; osgi.identity=my-test-26-karaf-2-routes; type=osgi.bundle;
version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused
by: Unable to resolve my-test-26-karaf-2-routes/0.0.1.SNAPSHOT: missing
requirement [my-test-26-karaf-2-routes/0.0.1.SNAPSHOT] osgi.service;
effective:=active; filter:="(objectClass=javax.jms.ConnectionFactory)"]]

I thought it may come from the class origin, but only one bundle seems to
export it. So I tried to find the issue elsewhere...

Inspecting the ActiveMQ OSGi bundle :
 52 │ Active   │  80 │ 5.17.1             │ ActiveMQ :: OSGi bundle

I saw that it also gets the class, but doesn't export it :

karaf@root()> bundle:classes 52 | grep javax.jms.ConnectionFactory
javax/jms/ConnectionFactory.class | exported: false

Can I deduce that the JMS connection factory service may have been created
using a bad class from a private package, and this may be the reason why it
doesn't match my reference, and perhaps why the camel-jms component doesn't
detect it ?

With previous versions of ActiveMQ I think it was working...

Thanks a lot for your help.

Regards.


Le lun. 22 août 2022 à 07:01, Jean-Baptiste Onofré <jb...@nanthrax.net> a
écrit :

> Hi,
>
> here's the documentation about camel-activemq:
> https://camel.apache.org/components/3.18.x/activemq-component.html
>
> About the ConnectionFactory, you have to define it as reference in
> your route. You can find an example here:
>
>
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
>
> https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml
>
> Regards
> JB
>
> On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
> <ep...@gmail.com> wrote:
> >
> > Hello.
> >
> > I've never seen any documentation about "camel-activeemq" : what's the
> > feature that provides it ?
> >
> > As I've said before, I've been trying to use camel-jms but surprisingly
> > my unique connection factory is not detected, and the component asks for
> > an explicit declaration. I thought that one unique connection factory
> > should be taken into account... I've created a unique connection factory
> > using "jms:create" connecting to an external ActiveMQ, and I've checked
> > that the service is present declaring the right interface. Is there a
> > special way of declaring or naming the connexion factory to make it
> > available for routes with camel-jms endpoints ?
> >
> > Thanks a lot for your help.
> >
> > Regards.
> >
> > Ephemeris Lappis
> >
> > Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > > That's correct: activemq-camel has been removed.
> > >
> > > You can now use camel-jms (recommended) or camel-activeemq.
> > >
> > > You can wrap your own component if needed, but I would rather update
> > > to camel-jms (not so hard to do).
> > >
> > > Regards
> > > JB
> > >
> > > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > > <ep...@gmail.com> wrote:
> > >> Hello.
> > >>
> > >> I've been working before on ActiveMQ 5.16.5, but as this version
> leads to
> > >> too many problems on Karaf 4.4.1 (spring compatibility among other
> issues),
> > >> I've decided to switch to ActiveMQ 5.17.1.
> > >>
> > >> Before, I think the component camel-activemq was provided by the
> feature
> > >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this
> feature,
> > >> if I'm not wrong...
> > >>
> > >> I've also tried as you suggested to use the jms component in my
> routes, but
> > >> the connection factory I've created to connect to my ActiveMQ server
> is not
> > >> taken into account by the component that requires an explicit
> connection
> > >> factory... Changing all our about 100 camel projects to change from
> > >> activemq to jms and declare a connection factory reference seems to
> be a
> > >> very bad choice for us...
> > >>
> > >> So, from both sides I've issues.
> > >>
> > >> Any idea to get out of this sad situation 😥 ?
> > >>
> > >> Thanks a lot !
> > >>
> > >> Regards.
> > >>
> > >> PS: Perhaps the documentation on the component should say that it's
> > >> available "Since Camel 1.0" but also only with restriction after a
> given
> > >> version...
> > >>
> > >>
> > >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a
> écrit :
> > >>
> > >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> > >>> It comes from Apache ActiveMQ 5.x instead.
> > >>>
> > >>> However starting from ActiveMQ 5.17 then they dropped their
> camel-activemq
> > >>> JAR and its no longer available.
> > >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ
> 5.16.x
> > >>>
> > >>> In the Camel website make sure to browse the components list for the
> Camel
> > >>> version you use. The list is different per version.
> > >>>
> > >>>
> > >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > >>> ephemeris.lappis@gmail.com> wrote:
> > >>>
> > >>>> Hello.
> > >>>>
> > >>>> I've already asked the question, but probably not clearly...
> > >>>>
> > >>>> I don't understand why I can't resolve the dependency for :
> > >>>> org.apache.camel:camel-activemq:jar:2.25.4
> > >>>>
> > >>>> I used this component for a long time on old servicemix
> environments,
> > >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > >>>> ActiveMQ 5.17.1).
> > >>>>
> > >>>> The component is still documented on the Camel components list, but
> I
> > >>>> can't find it.
> > >>>>
> > >>>> Any help ?
> > >>>>
> > >>>> Thanks in advance.
> > >>>>
> > >>>> Regards.
> > >>>>
> > >>>
> > >>> --
> > >>> Claus Ibsen
> > >>> -----------------
> > >>> http://davsclaus.com @davsclaus
> > >>> Camel in Action 2: https://www.manning.com/ibsen2
> > >>>
> >
> > --
> > Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> > www.avast.com
>

Re: Component activemq not found

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

here's the documentation about camel-activemq:
https://camel.apache.org/components/3.18.x/activemq-component.html

About the ConnectionFactory, you have to define it as reference in
your route. You can find an example here:

https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/route.xml
https://github.com/jbonofre/camel-amq-redelivery/blob/master/src/main/resources/OSGI-INF/blueprint/connectionfactory.xml

Regards
JB

On Sun, Aug 21, 2022 at 10:22 AM Ephemeris Lappis
<ep...@gmail.com> wrote:
>
> Hello.
>
> I've never seen any documentation about "camel-activeemq" : what's the
> feature that provides it ?
>
> As I've said before, I've been trying to use camel-jms but surprisingly
> my unique connection factory is not detected, and the component asks for
> an explicit declaration. I thought that one unique connection factory
> should be taken into account... I've created a unique connection factory
> using "jms:create" connecting to an external ActiveMQ, and I've checked
> that the service is present declaring the right interface. Is there a
> special way of declaring or naming the connexion factory to make it
> available for routes with camel-jms endpoints ?
>
> Thanks a lot for your help.
>
> Regards.
>
> Ephemeris Lappis
>
> Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> > That's correct: activemq-camel has been removed.
> >
> > You can now use camel-jms (recommended) or camel-activeemq.
> >
> > You can wrap your own component if needed, but I would rather update
> > to camel-jms (not so hard to do).
> >
> > Regards
> > JB
> >
> > On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> > <ep...@gmail.com> wrote:
> >> Hello.
> >>
> >> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> >> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> >> I've decided to switch to ActiveMQ 5.17.1.
> >>
> >> Before, I think the component camel-activemq was provided by the feature
> >> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> >> if I'm not wrong...
> >>
> >> I've also tried as you suggested to use the jms component in my routes, but
> >> the connection factory I've created to connect to my ActiveMQ server is not
> >> taken into account by the component that requires an explicit connection
> >> factory... Changing all our about 100 camel projects to change from
> >> activemq to jms and declare a connection factory reference seems to be a
> >> very bad choice for us...
> >>
> >> So, from both sides I've issues.
> >>
> >> Any idea to get out of this sad situation 😥 ?
> >>
> >> Thanks a lot !
> >>
> >> Regards.
> >>
> >> PS: Perhaps the documentation on the component should say that it's
> >> available "Since Camel 1.0" but also only with restriction after a given
> >> version...
> >>
> >>
> >> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
> >>
> >>> camel-activemq is not out of the box in Apache Camel in Camel v2.
> >>> It comes from Apache ActiveMQ 5.x instead.
> >>>
> >>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> >>> JAR and its no longer available.
> >>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> >>>
> >>> In the Camel website make sure to browse the components list for the Camel
> >>> version you use. The list is different per version.
> >>>
> >>>
> >>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> >>> ephemeris.lappis@gmail.com> wrote:
> >>>
> >>>> Hello.
> >>>>
> >>>> I've already asked the question, but probably not clearly...
> >>>>
> >>>> I don't understand why I can't resolve the dependency for :
> >>>> org.apache.camel:camel-activemq:jar:2.25.4
> >>>>
> >>>> I used this component for a long time on old servicemix environments,
> >>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> >>>> ActiveMQ 5.17.1).
> >>>>
> >>>> The component is still documented on the Camel components list, but I
> >>>> can't find it.
> >>>>
> >>>> Any help ?
> >>>>
> >>>> Thanks in advance.
> >>>>
> >>>> Regards.
> >>>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -----------------
> >>> http://davsclaus.com @davsclaus
> >>> Camel in Action 2: https://www.manning.com/ibsen2
> >>>
>
> --
> Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
> www.avast.com

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

I've never seen any documentation about "camel-activeemq" : what's the 
feature that provides it ?

As I've said before, I've been trying to use camel-jms but surprisingly 
my unique connection factory is not detected, and the component asks for 
an explicit declaration. I thought that one unique connection factory 
should be taken into account... I've created a unique connection factory 
using "jms:create" connecting to an external ActiveMQ, and I've checked 
that the service is present declaring the right interface. Is there a 
special way of declaring or naming the connexion factory to make it 
available for routes with camel-jms endpoints ?

Thanks a lot for your help.

Regards.

Ephemeris Lappis

Le 21/08/2022 à 08:12, Jean-Baptiste Onofré a écrit :
> That's correct: activemq-camel has been removed.
>
> You can now use camel-jms (recommended) or camel-activeemq.
>
> You can wrap your own component if needed, but I would rather update
> to camel-jms (not so hard to do).
>
> Regards
> JB
>
> On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
> <ep...@gmail.com> wrote:
>> Hello.
>>
>> I've been working before on ActiveMQ 5.16.5, but as this version leads to
>> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
>> I've decided to switch to ActiveMQ 5.17.1.
>>
>> Before, I think the component camel-activemq was provided by the feature
>> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
>> if I'm not wrong...
>>
>> I've also tried as you suggested to use the jms component in my routes, but
>> the connection factory I've created to connect to my ActiveMQ server is not
>> taken into account by the component that requires an explicit connection
>> factory... Changing all our about 100 camel projects to change from
>> activemq to jms and declare a connection factory reference seems to be a
>> very bad choice for us...
>>
>> So, from both sides I've issues.
>>
>> Any idea to get out of this sad situation 😥 ?
>>
>> Thanks a lot !
>>
>> Regards.
>>
>> PS: Perhaps the documentation on the component should say that it's
>> available "Since Camel 1.0" but also only with restriction after a given
>> version...
>>
>>
>> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
>>
>>> camel-activemq is not out of the box in Apache Camel in Camel v2.
>>> It comes from Apache ActiveMQ 5.x instead.
>>>
>>> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
>>> JAR and its no longer available.
>>> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
>>>
>>> In the Camel website make sure to browse the components list for the Camel
>>> version you use. The list is different per version.
>>>
>>>
>>> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
>>> ephemeris.lappis@gmail.com> wrote:
>>>
>>>> Hello.
>>>>
>>>> I've already asked the question, but probably not clearly...
>>>>
>>>> I don't understand why I can't resolve the dependency for :
>>>> org.apache.camel:camel-activemq:jar:2.25.4
>>>>
>>>> I used this component for a long time on old servicemix environments,
>>>> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
>>>> ActiveMQ 5.17.1).
>>>>
>>>> The component is still documented on the Camel components list, but I
>>>> can't find it.
>>>>
>>>> Any help ?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Regards.
>>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>

-- 
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com

Re: Component activemq not found

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
That's correct: activemq-camel has been removed.

You can now use camel-jms (recommended) or camel-activeemq.

You can wrap your own component if needed, but I would rather update
to camel-jms (not so hard to do).

Regards
JB

On Fri, Aug 19, 2022 at 12:33 PM Ephemeris Lappis
<ep...@gmail.com> wrote:
>
> Hello.
>
> I've been working before on ActiveMQ 5.16.5, but as this version leads to
> too many problems on Karaf 4.4.1 (spring compatibility among other issues),
> I've decided to switch to ActiveMQ 5.17.1.
>
> Before, I think the component camel-activemq was provided by the feature
> activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
> if I'm not wrong...
>
> I've also tried as you suggested to use the jms component in my routes, but
> the connection factory I've created to connect to my ActiveMQ server is not
> taken into account by the component that requires an explicit connection
> factory... Changing all our about 100 camel projects to change from
> activemq to jms and declare a connection factory reference seems to be a
> very bad choice for us...
>
> So, from both sides I've issues.
>
> Any idea to get out of this sad situation 😥 ?
>
> Thanks a lot !
>
> Regards.
>
> PS: Perhaps the documentation on the component should say that it's
> available "Since Camel 1.0" but also only with restriction after a given
> version...
>
>
> Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :
>
> > camel-activemq is not out of the box in Apache Camel in Camel v2.
> > It comes from Apache ActiveMQ 5.x instead.
> >
> > However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> > JAR and its no longer available.
> > Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
> >
> > In the Camel website make sure to browse the components list for the Camel
> > version you use. The list is different per version.
> >
> >
> > On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> > ephemeris.lappis@gmail.com> wrote:
> >
> > > Hello.
> > >
> > > I've already asked the question, but probably not clearly...
> > >
> > > I don't understand why I can't resolve the dependency for :
> > > org.apache.camel:camel-activemq:jar:2.25.4
> > >
> > > I used this component for a long time on old servicemix environments,
> > > and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > > ActiveMQ 5.17.1).
> > >
> > > The component is still documented on the Camel components list, but I
> > > can't find it.
> > >
> > > Any help ?
> > >
> > > Thanks in advance.
> > >
> > > Regards.
> > >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >

Re: Component activemq not found

Posted by Ephemeris Lappis <ep...@gmail.com>.
Hello.

I've been working before on ActiveMQ 5.16.5, but as this version leads to
too many problems on Karaf 4.4.1 (spring compatibility among other issues),
I've decided to switch to ActiveMQ 5.17.1.

Before, I think the component camel-activemq was provided by the feature
activemq-camel, but with 5.17.1 it doesn't appear anymore in this feature,
if I'm not wrong...

I've also tried as you suggested to use the jms component in my routes, but
the connection factory I've created to connect to my ActiveMQ server is not
taken into account by the component that requires an explicit connection
factory... Changing all our about 100 camel projects to change from
activemq to jms and declare a connection factory reference seems to be a
very bad choice for us...

So, from both sides I've issues.

Any idea to get out of this sad situation 😥 ?

Thanks a lot !

Regards.

PS: Perhaps the documentation on the component should say that it's
available "Since Camel 1.0" but also only with restriction after a given
version...


Le ven. 19 août 2022 à 11:51, Claus Ibsen <cl...@gmail.com> a écrit :

> camel-activemq is not out of the box in Apache Camel in Camel v2.
> It comes from Apache ActiveMQ 5.x instead.
>
> However starting from ActiveMQ 5.17 then they dropped their camel-activemq
> JAR and its no longer available.
> Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x
>
> In the Camel website make sure to browse the components list for the Camel
> version you use. The list is different per version.
>
>
> On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
> ephemeris.lappis@gmail.com> wrote:
>
> > Hello.
> >
> > I've already asked the question, but probably not clearly...
> >
> > I don't understand why I can't resolve the dependency for :
> > org.apache.camel:camel-activemq:jar:2.25.4
> >
> > I used this component for a long time on old servicemix environments,
> > and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> > ActiveMQ 5.17.1).
> >
> > The component is still documented on the Camel components list, but I
> > can't find it.
> >
> > Any help ?
> >
> > Thanks in advance.
> >
> > Regards.
> >
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Component activemq not found

Posted by Claus Ibsen <cl...@gmail.com>.
camel-activemq is not out of the box in Apache Camel in Camel v2.
It comes from Apache ActiveMQ 5.x instead.

However starting from ActiveMQ 5.17 then they dropped their camel-activemq
JAR and its no longer available.
Instead use the generic camel-jms instead. Or go back to ActiveMQ 5.16.x

In the Camel website make sure to browse the components list for the Camel
version you use. The list is different per version.


On Fri, Aug 19, 2022 at 11:35 AM Ephemeris Lappis <
ephemeris.lappis@gmail.com> wrote:

> Hello.
>
> I've already asked the question, but probably not clearly...
>
> I don't understand why I can't resolve the dependency for :
> org.apache.camel:camel-activemq:jar:2.25.4
>
> I used this component for a long time on old servicemix environments,
> and I'm trying to port my projects to Karaf using Camel 2.25.4 (and
> ActiveMQ 5.17.1).
>
> The component is still documented on the Camel components list, but I
> can't find it.
>
> Any help ?
>
> Thanks in advance.
>
> Regards.
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2