我很难让一个简单的PoC应用程序在Karaf 4.2.1和4.0.9(ServiceMix-7.0.1)中工作。
应用程序尝试使用org.osgi.service.component.ComponentFactory创建服务,但是在通过Karaf的功能文件格式进行部署的过程中,出现以下错误:
15:27:07.969 WARN [fileinstall-/Users/tmoreira2020/temp/apache-karaf-4.2.1/deploy] Unable to install Kar feature br.com.thiagomoreira.application/1.0.0.SNAPSHOT
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=br.com.thiagomoreira.application; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=br.com.thiagomoreira.application)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve br.com.thiagomoreira.application/1.0.0.SNAPSHOT: missing requirement [br.com.thiagomoreira.application/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=br.com.thiagomoreira.application; type=osgi.bundle; version="[1.0.0.201808301826,1.0.0.201808301826]"; resolution:=mandatory [caused by: Unable to resolve br.com.thiagomoreira.application/1.0.0.201808301826: missing requirement [br.com.thiagomoreira.application/1.0.0.201808301826] osgi.service; filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; effective:=active]]
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?]
at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392) ~[?:?]
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378) ~[?:?]
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332) ~[?:?]
at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388) ~[?:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025) ~[?:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:?]
at java.lang.Thread.run(Thread.java:748) ~[?:?]
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve br.com.thiagomoreira.application/1.0.0.SNAPSHOT: missing requirement [br.com.thiagomoreira.application/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=br.com.thiagomoreira.application; type=osgi.bundle; version="[1.0.0.201808301826,1.0.0.201808301826]"; resolution:=mandatory [caused by: Unable to resolve br.com.thiagomoreira.application/1.0.0.201808301826: missing requirement [br.com.thiagomoreira.application/1.0.0.201808301826] osgi.service; filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; effective:=active]
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?]
... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve br.com.thiagomoreira.application/1.0.0.201808301826: missing requirement [br.com.thiagomoreira.application/1.0.0.201808301826] osgi.service; filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; effective:=active
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?]
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?]
... 12 more
如果我独立部署捆绑包,例如没有kar文件一个接一个地进行,接线过程运行良好。
该项目的代码位于https://github.com/tmoreira2020/poc-osgi-whiteboard
我缺少什么?