osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

activemq-osgi generates MANIFEST.MF with double version arguments


Hi all,

I am trying to run ActiveMQ on Karaf, with Camel and CXF.

Short context:
Basic idea is to accept SOAP request ( over CXF ) and pass on the request
to ActiveMQ using Camel.

All versions of projects are build from GIT master ( see footnotes for
exact versions ).


Problem:
When I deploy ActiveMQ, Camel, CXF on Karaf, I see error in log, saying:

Caused by: java.lang.ClassNotFoundException:
org.apache.camel.component.jms.JmsBinding not found by
org.apache.activemq.activemq-osgi [195]

I've installed Camel feature camel-jms ( this features exports class
JmsBinding ). I can see JmsBinding class is exported from the camel-jms
bundle.

Even with this error printed in log file I can run example ( works as
promoted ). But this made me look at the project activemq-osgi, and pom.xml
file inside this project.


It has this values for import packages (:
( pom.xml:46 )
org.apache.camel*;version:="${camel-version-range}";resolution:=optional,

where camel-version-range is set to:
<camel-version-range>[2.20,3)</camel-version-range>


This produces MANIFEST.MF file as:

org.apache.camel.component.jms;version="[2.20,3)";version="[2.22,3)";resolution:=optional

So, 2.22 is taken from Camel dependency that is set to
<camel-version>2.22.0</camel-version>

Basically the only question/dilemma here is: is this correct? Can OSGi
package-import has multiple "Version" arguments?

I've changed pom.xml ( inside activemq-osgi ) to have imports defined like
this:



org.apache.camel.component.jms;version="${camel-version-range}";resolution:=optional,
  org.apache.camel.*;resolution:=optional,

( added version only for org.apache.camel.component.jms, and left out for
all other packages inside org.apache.camel, as it looks like, version is
added automatically -- did not find where this is )

And this created "correct" MANIFEST.MF. Even with this change I see error
as before, but I guess this is better MANIFEST.MF, or not?


Versions used:

  - Karaf 4.2.2-SNAPSHOT
  - ActiveMQ 5.16.0-SNAPSHOT
  - Camel 2.23.0-SNAPSHOT

All from GitHub, build today ( 13.12.2018 ).

Kind Regards,
Miroslav



-- 
Miroslav Beranič
MIBESIS
+386(0)40/814-843
miroslav.beranic@xxxxxxxxxx
http://www.mibesis.si