问题描述
我目前正在开发一个骆驼路由,它从 netty4/mllp 端点读取并将 hl7 消息存储到 amqp 队列.
这是我的环境:
- apache-maven-3.3.9
- apache-karaf-4.1.1
- apache-camel-2.18.3
- apache-artemis-2.0.0
这是我的 pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>*****</groupId><artifactId>*****</artifactId><version>0.0.1-SNAPSHOT</version><packaging>bundle</packaging><姓名>*****</姓名><构建><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.6.1</version><配置><来源>1.8</来源><目标>1.8</目标></配置></插件><groupId>org.apache.felix</groupId><artifactId>maven-bundle-plugin</artifactId><version>3.3.0</version><extensions>true</extensions><配置><使用说明><Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName><Bundle-SymbolicName>${project.artifactId}-bundle</Bundle-SymbolicName><Bundle-Activator>${project.groupId}.${project.artifactId}.*****.*****</Bundle-Activator></说明></配置></插件></plugins></build><依赖项><依赖><groupId>org.osgi</groupId><artifactId>org.osgi.core</artifactId><version>6.0.0</version></依赖><依赖><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.7.25</version></依赖><依赖><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-slf4j-impl</artifactId><version>2.8.1</version></依赖><依赖><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-core</artifactId><version>2.8.1</version></依赖><依赖><groupId>org.apache.camel</groupId><artifactId>camel-core</artifactId><version>2.18.3</version></依赖><依赖><groupId>org.apache.camel</groupId><artifactId>camel-amqp</artifactId><version>2.18.3</version></依赖><依赖><groupId>org.apache.camel</groupId><artifactId>camel-netty4</artifactId><version>2.18.3</version></依赖><依赖><groupId>org.apache.camel</groupId><artifactId>camel-hl7</artifactId><version>2.18.3</version></依赖></依赖项>
我可以使用主"类在 Eclipse 中运行该项目,没有问题.但是当我将包部署到 Karaf 容器时,我遇到了一些问题.
我正在生成bundle jar,使用previus pom.xml 文件,使用apache felix 插件,maven clean package
目标.
karaf 安装是干净的.我只设置了以下内容:
- 同一 karaf 容器内的 artemis amqp 代理
feature:repo-add artemis功能:安装artemis-amqp
- 骆驼组件
feature:repo-addcamel功能:安装camel-corecamel-netty4camel-amqpcamel-hl7
我将 jar 包复制到部署文件夹中并尝试使用 bundle:start my-bundle
启动它,但出现以下错误.
执行命令时出错:在包上执行命令时出错:启动包 110 时出错:无法解析 demograficos-bundle [110](R 110.0):缺少需求 [demograficos-bundle [110](R 110.0)] osgi.wiring.package;(&(osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0))) 未解决的需求:[[demograficos-bundle [110](R 110.0)]osgi.wiring.package;(&(osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0)))]
我由此了解到容器中缺少 jms 实现.
我尝试了 feature:install jms
,但现在出现以下错误
但是我看不到列出的两个以前的 geronimo 包,只有一个
START LEVEL 100 , List Threshold: 50身份证 |状态 |等级 |版本 |姓名----+-----------+-----+----------------+------------------------------------------------------------------------------------------28 |活跃 |80 |4.1.1 |Apache Karaf :: OSGi 服务 :: 事件52 |活跃 |80 |19.0.0 |Guava:用于 Java 的 Google 核心库53 |活跃 |80 |4.1.6.决赛 |网络/缓冲区54 |活跃 |80 |4.1.6.决赛 |网络/编解码器55 |活跃 |80 |4.1.6.决赛 |Netty/编解码器/HTTP56 |活跃 |80 |4.1.6.决赛 |Netty/普通57 |活跃 |80 |4.1.6.决赛 |网络/处理程序58 |活跃 |80 |4.1.6.决赛 |Netty/解析器59 |活跃 |80 |4.1.6.决赛 |网络/运输60 |活跃 |80 |3.0.0 |表达式语言 3.0 API61 |活跃 |80 |1.2.0 |CDI API62 |活跃 |80 |1.2 |javax.interceptor API63 |活跃 |80 |1.2 |javax.transaction API64 |活跃 |80 |2.0.0 |ActiveMQ Artemis AMQP 协议65 |活跃 |80 |2.0.0 |ActiveMQ Artemis 原生 POM66 |活跃 |80 |2.0.0 |ActiveMQ Artemis 服务器 OSGi67 |活跃 |80 |1.1.1 |Apache Aries 事务蓝图68 |活跃 |80 |2.1.0 |Apache Aries 事务蓝图69 |活跃 |80 |1.3.2 |Apache Aries 事务管理器70 |活跃 |80 |1.9.2 |Apache Commons BeanUtils71 |活跃 |80 |3.2.2 |Apache Commons 集合72 |活跃 |80 |1.0.2 |Apache Felix 协调器服务75 |活跃 |80 |1.0.0.alpha-2 |Apache Geronimo JMS 规范 2.076 |活跃 |80 |1.0.0.alpha-1 |Apache Geronimo JSon 规范 1.077 |活跃 |80 |0.9.5 |约翰松::核心81 |活跃 |80 |0.20.0 |QpidJMS 客户端82 |活跃 |80 |0.16.0 |质子-j83 |活跃 |80 |1.0.0.2 |Apache ServiceMix :: 捆绑包 :: javax.inject84 |活跃 |80 |3.3.0.决赛 |JBoss 日志 385 |活跃 |80 |3.6.9.决赛 |JGroups86 |活跃 |50 |2.18.3 |骆驼-amqp87 |活跃 |50 |2.18.3 |骆驼目录88 |活跃 |50 |2.18.3 |骆驼命令核心89 |活跃 |50 |2.18.3 |骆驼核90 |活跃 |50 |2.18.3 |骆驼-jms91 |活跃 |80 |2.18.3 |骆驼卡拉夫命令92 |活跃 |50 |1.6.0 |共享池105 |活跃 |50 |4.1.7.决赛 |Netty/传输/本机/Epoll106 |活跃 |50 |2.18.3 |骆驼netty4107 |活跃 |50 |2.2 |HAPI - Java HL7 API - OSGI 包108 |活跃 |50 |2.18.3 |骆驼-hl7109 |活跃 |50 |2.0.14 |Apache MINA 核心110 |已安装 |80 |0.0.1.快照 |**********111 |活跃 |80 |2.0.0 |ActiveMQ Artemis HornetQ 协议112 |活跃 |80 |2.0.0 |ActiveMQ Artemis HQClient 协议114 |活跃 |80 |4.1.6.决赛 |Netty/编解码器/MQTT115 |活跃 |80 |2.0.0 |ActiveMQ Artemis MQTT 协议116 |活跃 |80 |2.0.0 |ActiveMQ Artemis OpenWire 协议117 |活跃 |80 |2.0.0 |ActiveMQ Artemis STOMP 协议118 |活跃 |80 |1.0.1 |geronimo-j2ee-management_1.1_spec119 |活跃 |80 |1.11.0 |缓存缓冲区123 |活跃 |80 |4.1.1 |Apache Karaf :: JMS :: 核心karaf@root()>捆绑:树秀 *****捆绑包 **********-捆绑包 [110] 当前已安装- 导入 javax.jms;version="[1.1,2)": 使用 org.apache.geronimo.specs.geronimo-jms_1.1_spec [122] 解决- 导入 org.apache.camel;version="[2.18,3)": 使用 org.apache.camel.camel-core [89] 解决- 导入 org.apache.camel.builder;version="[2.18,3)": 使用 org.apache.camel.camel-core [89] 解决- 导入 org.apache.camel.component.amqp;version="[2.18,3)": 使用 org.apache.camel.camel-amqp [86] 解决- 导入 org.apache.camel.component.hl7;version="[2.18,3)": 使用 org.apache.camel.camel-hl7 [108] 解决- 导入 org.apache.camel.impl;version="[2.18,3)": 使用 org.apache.camel.camel-core [89] 解决- 导入 org.apache.camel.model;version="[2.18,3)": 使用 org.apache.camel.camel-core [89] 解决- 导入 org.apache.camel.spi;version="[2.18,3)": 使用 org.apache.camel.camel-core [89] 解决- 导入 org.osgi.framework;version="[1.8,2)": 使用 org.apache.felix.framework [0] 解决- import org.slf4j;version="[1.7,2)": 使用 org.ops4j.pax.logging.pax-logging-api [5] 解决- import org.slf4j;version="[1.7,2)": 使用 org.ops4j.pax.logging.pax-logging-api [5] 解决- import org.slf4j;version="[1.7,2)": 使用 org.ops4j.pax.logging.pax-logging-api [5] 解决警告:下面的树是可能分辨率的粗略近似值demograficos-bundle [110]+- org.apache.geronimo.specs.geronimo-jms_1.1_spec [122]|+- javax.transaction-api [63]|+- javax.enterprise.cdi-api [61]||+- javax.el-api [60]||+- org.apache.servicemix.bundles.javax-inject [83]||+- javax.interceptor-api [62]|+- javax.interceptor-api [62]+- org.apache.camel.camel-core [89]|+- org.ops4j.pax.logging.pax-logging-api [5]||+- org.apache.karaf.services.eventadmin [3]||+- org.apache.felix.metatype [2]||+- org.apache.felix.configadmin [7]|+- org.apache.servicemix.bundles.spring-tx [102]|+- org.ops4j.pax.logging.pax-logging-api [5]|+- org.apache.servicemix.bundles.aoalliance [93]|+- javax.transaction-api [63]|+- org.apache.servicemix.bundles.spring-aop [95]||+- org.ops4j.pax.logging.pax-logging-api [5]||+- org.apache.servicemix.bundles.aoalliance [93]||+- org.apache.commons.pool [92]||+- org.apache.servicemix.bundles.spring-beans [96]|||+- org.ops4j.pax.logging.pax-logging-api [5]|||+- org.apache.servicemix.bundles.javax-inject [83]|||+- org.apache.servicemix.bundles.spring-core [99]|||+- org.ops4j.pax.logging.pax-logging-api [5]||+- org.apache.servicemix.bundles.spring-core [99]|+- org.apache.servicemix.bundles.spring-beans [96]|+- org.apache.servicemix.bundles.spring-core [99]|+- org.apache.servicemix.bundles.spring-context [97]|+- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]||+- javax.transaction-api [63]|+- org.ops4j.pax.logging.pax-logging-api [5]|+- org.apache.servicemix.bundles.javax-inject [83]|+- org.apache.servicemix.bundles.spring-expression [100]||+- org.ops4j.pax.logging.pax-logging-api [5]||+- org.apache.servicemix.bundles.spring-core [99]|+- org.apache.servicemix.bundles.aoalliance [93]|+- javax.interceptor-api [62]|+- org.apache.servicemix.bundles.spring-aop [95]|+- org.apache.servicemix.bundles.spring-beans [96]|+- org.apache.servicemix.bundles.spring-core [99]+- org.apache.camel.camel-amqp [86]|+- org.apache.camel.camel-core [89]|+- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]|+- org.apache.qpid.jms.client [81]||+- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]||+- org.ops4j.pax.logging.pax-logging-api [5]||+- io.netty.handler [57]|||+- io.netty.codec [54]||||+- io.netty.buffer [53]|||||+- io.netty.common [56]|||||+- org.ops4j.pax.logging.pax-logging-api [5]||||+- io.netty.transport [59]|||||+- io.netty.resolver [58]||||||+- io.netty.common [56]|||||+- io.netty.buffer [53]|||||+- io.netty.common [56]||||+- io.netty.common [56]|||+- io.netty.buffer [53]|||+- io.netty.transport [59]|||+- io.netty.common [56]||+- io.netty.codec-http [55]|||+- io.netty.codec [54]|||+- io.netty.handler [57]|||+- io.netty.buffer [53]|||+- io.netty.transport [59]|||+- io.netty.common [56]||+- org.apache.qpid.proton-j [82]||+- io.netty.buffer [53]||+- io.netty.transport [59]||+- io.netty.common [56]|+- org.apache.camel.camel-jms [90]|+- org.apache.camel.camel-core [89]|+- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]|+- org.ops4j.pax.logging.pax-logging-api [5]|+- org.apache.servicemix.bundles.spring-jms [101]||+- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]||+- org.ops4j.pax.logging.pax-logging-api [5]||+- org.apache.servicemix.bundles.spring-tx [102]||+- org.apache.servicemix.bundles.spring-expression [100]||+- org.apache.servicemix.bundles.aoalliance [93]||+- org.apache.servicemix.bundles.spring-aop [95]||+- io.netty.transport [59]||+- org.apache.servicemix.bundles.spring-beans [96]||+- org.apache.servicemix.bundles.spring-core [99]||+- io.netty.common [56]||+- org.apache.servicemix.bundles.spring-context [97]|+- org.apache.servicemix.bundles.spring-tx [102]|+- org.apache.servicemix.bundles.spring-beans [96]|+- org.apache.servicemix.bundles.spring-core [99]|+- org.apache.servicemix.bundles.spring-context [97]+- org.apache.camel.camel-hl7 [108]|+- org.apache.camel.camel-core [89]|+- io.netty.codec [54]|+- org.ops4j.pax.logging.pax-logging-api [5]|+- org.apache.camel.camel-netty4 [106]||+- org.apache.camel.camel-core [89]||+- io.netty.codec [54]||+- org.ops4j.pax.logging.pax-logging-api [5]||+- io.netty.handler [57]||+- io.netty.transport [59]||+- io.netty.buffer [53]||+- org.apache.commons.pool [92]||+- io.netty.transport-native-epoll [105]|||+- io.netty.buffer [53]|||+- io.netty.transport [59]|||+- io.netty.common [56]||+- io.netty.common [56]|+- org.apache.mina.core [109]||+- org.ops4j.pax.logging.pax-logging-api [5]|+- io.netty.buffer [53]|+- ca.uhn.hapi.osgi-base [107]||+- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]|+- io.netty.transport [59]+- org.apache.felix.framework [0]+- org.ops4j.pax.logging.pax-logging-api [5]警告:多个包正在导出包 javax.jms- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]- org.apache.geronimo.specs.geronimo-jms_1.1_spec [122]
我真的很难理解 jar/bundle 版本如何在 karaf 下协同工作.
有什么想法吗?也许我应该更改 pom.xml 中的 felix 插件
看起来你在 1.1 版中声明了自己的导出 javax.jms 包的包,而 Artemis 依赖于 2.0 版中导出 javax.jms 的包,确保您还依赖于 2.0 版 javax.jms 版本(因为这是 artemis 使用的版本),您的问题就会消失.
I am currenty developing a camel route which reads from a netty4/mllp endpoint and store the hl7 message to a amqp queue.
This is my environment:
- apache-maven-3.3.9
- apache-karaf-4.1.1
- apache-camel-2.18.3
- apache-artemis-2.0.0
this is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>*****</groupId>
<artifactId>*****</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>*****</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.3.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-SymbolicName>${project.artifactId}-bundle</Bundle-SymbolicName>
<Bundle-Activator>${project.groupId}.${project.artifactId}.*****.*****</Bundle-Activator>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.18.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-amqp</artifactId>
<version>2.18.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-netty4</artifactId>
<version>2.18.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hl7</artifactId>
<version>2.18.3</version>
</dependency>
</dependencies>
I can run the project in eclipse with a "main" class with no problem. But when I am deploying the bundle to the Karaf container I am experiencing some issues.
I am generating the bundle jar, with the previus pom.xml file, with the apache felix plugin, maven clean package
goal.
The karaf installation is a clean one. I have only setup the following:
- the artemis amqp broker inside the same karaf container
feature:repo-add artemisfeature:install artemis-amqp
- the camel components
feature:repo-add camelfeature:install camel-core camel-netty4 camel-amqp camel-hl7
I copy the jar bundle into the deploy folder and try to start it with bundle:start my-bundle
but I get the following error.
Error executing command: Error executing command on bundles:
Error starting bundle 110: Unable to resolve demograficos-bundle [110](R 110.0): missing requirement [demograficos-bundle [110](R 110.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0))) Unresolved requirements: [[demograficos-bundle [110](R 110.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0)))]
I understand from this that the jms implementation is missing from the container.
I tried feature:install jms
, but now I got the following error
Error executing command: Error executing command on bundles: Error starting bundle 110: Uses constraint violation. Unable to resolve resource demograficos-bundle [demograficos-bundle [110](R 110.0)] because it is exposed to package 'javax.jms' from resources org.apache.geronimo.specs.geronimo-jms_1.1_spec [org.apache.geronimo.specs.geronimo-jms_1.1_spec [120](R 120.0)] and org.apache.geronimo.specs.geronimo-jms_2.0_spec [org.apache.geronimo.specs.geronimo-jms_2.0_spec [75](R 75.0)] via two dependency chains. Chain 1: demograficos-bundle [demograficos-bundle [110](R 110.0)] import: (&(osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=2.0.0))) | export: osgi.wiring.package: javax.jms org.apache.geronimo.specs.geronimo-jms_1.1_spec [org.apache.geronimo.specs.geronimo-jms_1.1_spec [120](R 120.0)] Chain 2: demograficos-bundle [demograficos-bundle [110](R 110.0)] import: (&(osgi.wiring.package=org.apache.camel.component.amqp)(version>=2.18.0)(!(version>=3.0.0))) | export: osgi.wiring.package=org.apache.camel.component.amqp; uses:=javax.jms org.apache.camel.camel-amqp [org.apache.camel.camel-amqp [86](R 86.0)] import: (&(osgi.wiring.package=javax.jms)(version>=1.1.0)(!(version>=3.0.0))) | export: osgi.wiring.package: javax.jms org.apache.geronimo.specs.geronimo-jms_2.0_spec [org.apache.geronimo.specs.geronimo-jms_2.0_spec [75](R 75.0)] Unresolved requirements: [[demograficos-bundle [110](R 110.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.camel.component.amqp)(version>=2.18.0)(!(version>=3.0.0)))]
But I can't see the two previus geronimo bundles listed, only one
START LEVEL 100 , List Threshold: 50
ID | State | Lvl | Version | Name
----+-----------+-----+----------------+---------------------------------------------------------------------------------------------------
28 | Active | 80 | 4.1.1 | Apache Karaf :: OSGi Services :: Event
52 | Active | 80 | 19.0.0 | Guava: Google Core Libraries for Java
53 | Active | 80 | 4.1.6.Final | Netty/Buffer
54 | Active | 80 | 4.1.6.Final | Netty/Codec
55 | Active | 80 | 4.1.6.Final | Netty/Codec/HTTP
56 | Active | 80 | 4.1.6.Final | Netty/Common
57 | Active | 80 | 4.1.6.Final | Netty/Handler
58 | Active | 80 | 4.1.6.Final | Netty/Resolver
59 | Active | 80 | 4.1.6.Final | Netty/Transport
60 | Active | 80 | 3.0.0 | Expression Language 3.0 API
61 | Active | 80 | 1.2.0 | CDI APIs
62 | Active | 80 | 1.2 | javax.interceptor API
63 | Active | 80 | 1.2 | javax.transaction API
64 | Active | 80 | 2.0.0 | ActiveMQ Artemis AMQP Protocol
65 | Active | 80 | 2.0.0 | ActiveMQ Artemis Native POM
66 | Active | 80 | 2.0.0 | ActiveMQ Artemis Server OSGi
67 | Active | 80 | 1.1.1 | Apache Aries Transaction Blueprint
68 | Active | 80 | 2.1.0 | Apache Aries Transaction Blueprint
69 | Active | 80 | 1.3.2 | Apache Aries Transaction Manager
70 | Active | 80 | 1.9.2 | Apache Commons BeanUtils
71 | Active | 80 | 3.2.2 | Apache Commons Collections
72 | Active | 80 | 1.0.2 | Apache Felix Coordinator Service
75 | Active | 80 | 1.0.0.alpha-2 | Apache Geronimo JMS Spec 2.0
76 | Active | 80 | 1.0.0.alpha-1 | Apache Geronimo JSon Spec 1.0
77 | Active | 80 | 0.9.5 | Johnzon :: Core
81 | Active | 80 | 0.20.0 | QpidJMS Client
82 | Active | 80 | 0.16.0 | proton-j
83 | Active | 80 | 1.0.0.2 | Apache ServiceMix :: Bundles :: javax.inject
84 | Active | 80 | 3.3.0.Final | JBoss Logging 3
85 | Active | 80 | 3.6.9.Final | JGroups
86 | Active | 50 | 2.18.3 | camel-amqp
87 | Active | 50 | 2.18.3 | camel-catalog
88 | Active | 50 | 2.18.3 | camel-commands-core
89 | Active | 50 | 2.18.3 | camel-core
90 | Active | 50 | 2.18.3 | camel-jms
91 | Active | 80 | 2.18.3 | camel-karaf-commands
92 | Active | 50 | 1.6.0 | Commons Pool
105 | Active | 50 | 4.1.7.Final | Netty/Transport/Native/Epoll
106 | Active | 50 | 2.18.3 | camel-netty4
107 | Active | 50 | 2.2 | HAPI - Java HL7 API - OSGI Bundle
108 | Active | 50 | 2.18.3 | camel-hl7
109 | Active | 50 | 2.0.14 | Apache MINA Core
110 | Installed | 80 | 0.0.1.SNAPSHOT | **********
111 | Active | 80 | 2.0.0 | ActiveMQ Artemis HornetQ Protocol
112 | Active | 80 | 2.0.0 | ActiveMQ Artemis HQClient Protocol
114 | Active | 80 | 4.1.6.Final | Netty/Codec/MQTT
115 | Active | 80 | 2.0.0 | ActiveMQ Artemis MQTT Protocol
116 | Active | 80 | 2.0.0 | ActiveMQ Artemis OpenWire Protocol
117 | Active | 80 | 2.0.0 | ActiveMQ Artemis STOMP Protocol
118 | Active | 80 | 1.0.1 | geronimo-j2ee-management_1.1_spec
119 | Active | 80 | 1.11.0 | hawtbuf
123 | Active | 80 | 4.1.1 | Apache Karaf :: JMS :: Core
karaf@root()> bundle:tree-show *****
Bundle **********-bundle [110] is currently INSTALLED
- import javax.jms;version="[1.1,2)": resolved using org.apache.geronimo.specs.geronimo-jms_1.1_spec [122]
- import org.apache.camel;version="[2.18,3)": resolved using org.apache.camel.camel-core [89]
- import org.apache.camel.builder;version="[2.18,3)": resolved using org.apache.camel.camel-core [89]
- import org.apache.camel.component.amqp;version="[2.18,3)": resolved using org.apache.camel.camel-amqp [86]
- import org.apache.camel.component.hl7;version="[2.18,3)": resolved using org.apache.camel.camel-hl7 [108]
- import org.apache.camel.impl;version="[2.18,3)": resolved using org.apache.camel.camel-core [89]
- import org.apache.camel.model;version="[2.18,3)": resolved using org.apache.camel.camel-core [89]
- import org.apache.camel.spi;version="[2.18,3)": resolved using org.apache.camel.camel-core [89]
- import org.osgi.framework;version="[1.8,2)": resolved using org.apache.felix.framework [0]
- import org.slf4j;version="[1.7,2)": resolved using org.ops4j.pax.logging.pax-logging-api [5]
- import org.slf4j;version="[1.7,2)": resolved using org.ops4j.pax.logging.pax-logging-api [5]
- import org.slf4j;version="[1.7,2)": resolved using org.ops4j.pax.logging.pax-logging-api [5]
Warning: the below tree is a rough approximation of a possible resolution
demograficos-bundle [110]
+- org.apache.geronimo.specs.geronimo-jms_1.1_spec [122]
| +- javax.transaction-api [63]
| +- javax.enterprise.cdi-api [61]
| | +- javax.el-api [60]
| | +- org.apache.servicemix.bundles.javax-inject [83]
| | +- javax.interceptor-api [62]
| +- javax.interceptor-api [62]
+- org.apache.camel.camel-core [89]
| +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- org.apache.karaf.services.eventadmin [3]
| | +- org.apache.felix.metatype [2]
| | +- org.apache.felix.configadmin [7]
| +- org.apache.servicemix.bundles.spring-tx [102]
| +- org.ops4j.pax.logging.pax-logging-api [5]
| +- org.apache.servicemix.bundles.aopalliance [93]
| +- javax.transaction-api [63]
| +- org.apache.servicemix.bundles.spring-aop [95]
| | +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- org.apache.servicemix.bundles.aopalliance [93]
| | +- org.apache.commons.pool [92]
| | +- org.apache.servicemix.bundles.spring-beans [96]
| | | +- org.ops4j.pax.logging.pax-logging-api [5]
| | | +- org.apache.servicemix.bundles.javax-inject [83]
| | | +- org.apache.servicemix.bundles.spring-core [99]
| | | +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- org.apache.servicemix.bundles.spring-core [99]
| +- org.apache.servicemix.bundles.spring-beans [96]
| +- org.apache.servicemix.bundles.spring-core [99]
| +- org.apache.servicemix.bundles.spring-context [97]
| +- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
| | +- javax.transaction-api [63]
| +- org.ops4j.pax.logging.pax-logging-api [5]
| +- org.apache.servicemix.bundles.javax-inject [83]
| +- org.apache.servicemix.bundles.spring-expression [100]
| | +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- org.apache.servicemix.bundles.spring-core [99]
| +- org.apache.servicemix.bundles.aopalliance [93]
| +- javax.interceptor-api [62]
| +- org.apache.servicemix.bundles.spring-aop [95]
| +- org.apache.servicemix.bundles.spring-beans [96]
| +- org.apache.servicemix.bundles.spring-core [99]
+- org.apache.camel.camel-amqp [86]
| +- org.apache.camel.camel-core [89]
| +- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
| +- org.apache.qpid.jms.client [81]
| | +- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
| | +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- io.netty.handler [57]
| | | +- io.netty.codec [54]
| | | | +- io.netty.buffer [53]
| | | | | +- io.netty.common [56]
| | | | | +- org.ops4j.pax.logging.pax-logging-api [5]
| | | | +- io.netty.transport [59]
| | | | | +- io.netty.resolver [58]
| | | | | | +- io.netty.common [56]
| | | | | +- io.netty.buffer [53]
| | | | | +- io.netty.common [56]
| | | | +- io.netty.common [56]
| | | +- io.netty.buffer [53]
| | | +- io.netty.transport [59]
| | | +- io.netty.common [56]
| | +- io.netty.codec-http [55]
| | | +- io.netty.codec [54]
| | | +- io.netty.handler [57]
| | | +- io.netty.buffer [53]
| | | +- io.netty.transport [59]
| | | +- io.netty.common [56]
| | +- org.apache.qpid.proton-j [82]
| | +- io.netty.buffer [53]
| | +- io.netty.transport [59]
| | +- io.netty.common [56]
| +- org.apache.camel.camel-jms [90]
| +- org.apache.camel.camel-core [89]
| +- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
| +- org.ops4j.pax.logging.pax-logging-api [5]
| +- org.apache.servicemix.bundles.spring-jms [101]
| | +- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
| | +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- org.apache.servicemix.bundles.spring-tx [102]
| | +- org.apache.servicemix.bundles.spring-expression [100]
| | +- org.apache.servicemix.bundles.aopalliance [93]
| | +- org.apache.servicemix.bundles.spring-aop [95]
| | +- io.netty.transport [59]
| | +- org.apache.servicemix.bundles.spring-beans [96]
| | +- org.apache.servicemix.bundles.spring-core [99]
| | +- io.netty.common [56]
| | +- org.apache.servicemix.bundles.spring-context [97]
| +- org.apache.servicemix.bundles.spring-tx [102]
| +- org.apache.servicemix.bundles.spring-beans [96]
| +- org.apache.servicemix.bundles.spring-core [99]
| +- org.apache.servicemix.bundles.spring-context [97]
+- org.apache.camel.camel-hl7 [108]
| +- org.apache.camel.camel-core [89]
| +- io.netty.codec [54]
| +- org.ops4j.pax.logging.pax-logging-api [5]
| +- org.apache.camel.camel-netty4 [106]
| | +- org.apache.camel.camel-core [89]
| | +- io.netty.codec [54]
| | +- org.ops4j.pax.logging.pax-logging-api [5]
| | +- io.netty.handler [57]
| | +- io.netty.transport [59]
| | +- io.netty.buffer [53]
| | +- org.apache.commons.pool [92]
| | +- io.netty.transport-native-epoll [105]
| | | +- io.netty.buffer [53]
| | | +- io.netty.transport [59]
| | | +- io.netty.common [56]
| | +- io.netty.common [56]
| +- org.apache.mina.core [109]
| | +- org.ops4j.pax.logging.pax-logging-api [5]
| +- io.netty.buffer [53]
| +- ca.uhn.hapi.osgi-base [107]
| | +- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
| +- io.netty.transport [59]
+- org.apache.felix.framework [0]
+- org.ops4j.pax.logging.pax-logging-api [5]
WARNING: multiple bundles are exporting package javax.jms
- org.apache.geronimo.specs.geronimo-jms_2.0_spec [75]
- org.apache.geronimo.specs.geronimo-jms_1.1_spec [122]
I am really having some troubles understanding how jar/bundle versions work together under karaf.
Any ideas? maybe I should change the felix plugin in the pom.xml
Looks like you declared your own bundle exporting the javax.jms package to be in version 1.1, while Artemis depends on a bundle exporting javax.jms in version 2.0, make sure you also depend on a version 2.0 javax.jms version (as that's the version used by artemis) and your issue will be gone.
这篇关于在 karaf 中启动包时出错:“通过两个依赖链"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!