Skip to content

Conversation

@anatol-sialitski
Copy link
Contributor

To avoid an issue

org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=cdp-graphql-feature; type=karaf.feature; version="[2.6.0.SNAPSHOT,2.6.0.SNAPSHOT]"; filter:="(&(osgi.identity=cdp-graphql-feature)(type=karaf.feature)(version>=2.6.0.SNAPSHOT)(version<=2.6.0.SNAPSHOT))" [caused by: Unable to resolve cdp-graphql-feature/2.6.0.SNAPSHOT: missing requirement [cdp-graphql-feature/2.6.0.SNAPSHOT] osgi.identity; osgi.identity=graphql-java-annotations; type=osgi.bundle; version="[21.5.0,21.5.0]"; resolution:=mandatory [caused by: Unable to resolve graphql-java-annotations/21.5.0: missing requirement [graphql-java-annotations/21.5.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=graphql)(version>=21.5.0)(!(version>=22.0.0)))" [caused by: Unable to resolve graphql-java/21.5.0: missing requirement [graphql-java/21.5.0] osgi.wiring.package; filter:="(osgi.wiring.package=java.io)"]]] 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:401) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1063) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve cdp-graphql-feature/2.6.0.SNAPSHOT: missing requirement [cdp-graphql-feature/2.6.0.SNAPSHOT] osgi.identity; osgi.identity=graphql-java-annotations; type=osgi.bundle; version="[21.5.0,21.5.0]"; resolution:=mandatory [caused by: Unable to resolve graphql-java-annotations/21.5.0: missing requirement [graphql-java-annotations/21.5.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=graphql)(version>=21.5.0)(!(version>=22.0.0)))" [caused by: Unable to resolve graphql-java/21.5.0: missing requirement [graphql-java/21.5.0] osgi.wiring.package; filter:="(osgi.wiring.package=java.io)"]] at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ... 12 more Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve graphql-java-annotations/21.5.0: missing requirement [graphql-java-annotations/21.5.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=graphql)(version>=21.5.0)(!(version>=22.0.0)))" [caused by: Unable to resolve graphql-java/21.5.0: missing requirement [graphql-java/21.5.0] osgi.wiring.package; filter:="(osgi.wiring.package=java.io)"] at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ... 13 more Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve graphql-java/21.5.0: missing requirement [graphql-java/21.5.0] osgi.wiring.package; filter:="(osgi.wiring.package=java.io)" at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ... 14 more Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=cdp-graphql-feature; type=karaf.feature; version="[2.6.0.SNAPSHOT,2.6.0.SNAPSHOT]"; filter:="(&(osgi.identity=cdp-graphql-feature)(type=karaf.feature)(version>=2.6.0.SNAPSHOT)(version<=2.6.0.SNAPSHOT))" [caused by: Unable to resolve cdp-graphql-feature/2.6.0.SNAPSHOT: missing requirement [cdp-graphql-feature/2.6.0.SNAPSHOT] osgi.identity; osgi.identity=graphql-java-annotations; type=osgi.bundle; version="[21.5.0,21.5.0]"; resolution:=mandatory [caused by: Unable to resolve graphql-java-annotations/21.5.0: missing requirement [graphql-java-annotations/21.5.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=graphql)(version>=21.5.0)(!(version>=22.0.0)))" [caused by: Unable to resolve graphql-java/21.5.0: missing requirement [graphql-java/21.5.0] osgi.wiring.package; filter:="(osgi.wiring.package=java.io)"]]] 
@Fgerthoffert
Copy link
Collaborator

@anatol-sialitski is that related to your work on this PR: apache/unomi#562 ?

@anatol-sialitski
Copy link
Contributor Author

Yes, it is. But you can contact @sergehuber to discuss it with him. Maybe we can solve it another way by adding extra configuration for Karaf in Unomi project.

@jayblanc
Copy link
Collaborator

jayblanc commented Nov 7, 2024

Did you considere using the bnd tool option : -noimportjava: true ?
That may need to upgrade gradle dependencies for OSGI to :
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0'
(...)
compileOnly 'org.osgi:org.osgi.service.component:1.5.1'
compileOnly 'org.osgi:org.osgi.service.component.annotations:1.5.1'
compileOnly 'biz.aQute.bnd:biz.aQute.bndlib:7.0.0'

@jayblanc
Copy link
Collaborator

jayblanc commented Nov 7, 2024

Anyway, the OSGI framework (depending on its version) should export all related java.* packages allowing any bundle to import them. Maybe the problem relates to Karaf in that particular case.
( bndtools/bnd#2507)

@anatol-sialitski
Copy link
Contributor Author

Yes, we are going to look at the configuration more closely, as I mentioned above :)

Thank you for your advice! I tried to use that in our Karaf feature.xml, but it didn’t help.

<bundle start-level="80">wrap:mvn:io.github.graphql-java/graphql-java-annotations/${graphql.java.annotations.version}$Import-Package=!java.*,*</bundle> 
@jayblanc
Copy link
Collaborator

jayblanc commented Nov 7, 2024

An upgrade of Karaf version in unomi is also something to investigate ; this would solve other issues (security) on current version and maybe also the export of java.* packages

@jayblanc
Copy link
Collaborator

jayblanc commented Dec 5, 2024

@anatol-sialitski Any update ?

@Fgerthoffert
Copy link
Collaborator

@anatol-sialitski Any updates following @jayblanc comments ?

@anatol-sialitski
Copy link
Contributor Author

There are no updates on it. I will convert the PR to draft.

@anatol-sialitski anatol-sialitski marked this pull request as draft February 6, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants