I'm having hard time to get a simple PoC application to work in Karaf 4.2.1 and 4.0.9 (ServiceMix - 7.0.1).
The application tries to create services using a org.osgi.service.component.ComponentFactory but during deployment time via Karaf's feature file format I get the following error:
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
If I deploy the bundles independently, e.g. one after another without the kar file, the wiring process works well.
The project's code is available at https://github.com/tmoreira2020/poc-osgi-whiteboard
What I'm missing?