我使用 karaf-maven-plugin 创建了 maven 发行版。
我使用创建了 Maven 项目
mvn archetype:generate -DarchetypeGroupId=org.apache.karaf.archetypes -DarchetypeArtifactId=karaf-assembly-archetype -DarchetypeVersion=4.1.0
然后我添加了以下功能:
<bootFeatures>
<feature>standard</feature>
<feature>jpa/2.5.0</feature>
<feature>transaction-api/1.2.0</feature>
<feature>transaction</feature>
<feature>eclipselink</feature>
<feature>pax-jdbc-config</feature>
<feature>pax-jdbc-postgresql</feature>
</bootFeatures>
当我从 Apache 站点下载 karaf 4.1.0 发行版并使用 feature:install 安装功能时,一切正常,但是,在由插件构建的发行版中,我收到错误:
由于未解决的依赖关系 [(objectClass=javax.transaction.TransactionManager)] java.util.concurrent.TimeoutException at org.apache.aries.blueprint,无法启动捆绑包 org.apache.aries.transaction.blueprint/1.1.1 的蓝图容器.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:371) [15:org.apache.aries.blueprint.core:1.7.1] 在 org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run( DiscardableRunnable.java:48) [15:org.apache.aries.blueprint.core:1.7.1] 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] 在 java. util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?] at java.util.concurrent .ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker。在 java.lang.Thread.run(Thread.java:745) [?:?] 处运行(ThreadPoolExecutor.java:617) [?:?]
2017-03-22T11:03:51,401 | 错误 | 蓝图扩展器:1 | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.7.1 | 由于未解决的依赖关系 [(objectClass=javax.transaction.TransactionManager)] java.util.concurrent.TimeoutException at org.apache.aries.blueprint,无法启动捆绑包 org.apache.aries.transaction.blueprint/2.1.0 的蓝图容器.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:371) [15:org.apache.aries.blueprint.core:1.7.1] 在 org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run( DiscardableRunnable.java:48) [15:org.apache.aries.blueprint.core:1.7.1] 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] 在 java. util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] 在 java.util。
我在 Web 控制台的 OSGi 注册表中找到了该服务:
Service 266 - [org.apache.aries.transaction.AriesTransactionManager, javax.transaction.TransactionManager, javax.transaction.TransactionSynchronizationRegistry, javax.transaction.UserTransaction, org.apache.geronimo.transaction.manager.RecoverableTransactionManager] (pid: n/a)
from Bundle 143 - Apache Aries Transaction Manager (org.apache.aries.transaction.manager), version 1.3.2
service.bundleid: 143
service.scope: singleton
这里有什么问题?maven 插件是否做错了什么,或者问题是,该插件使用了不稳定版本的工件?