Enigmatis / graphql-java-annotations

GraphQL Annotations for Java
Other
387 stars 97 forks source link

Fix MANIFEST FILE #307

Open anatol-sialitski opened 4 weeks ago

anatol-sialitski commented 4 weeks ago

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 commented 6 days ago

@anatol-sialitski is that related to your work on this PR: https://github.com/apache/unomi/pull/562 ?

anatol-sialitski commented 6 days ago

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 commented 6 days ago

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 commented 6 days ago

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. ( https://github.com/bndtools/bnd/issues/2507)

anatol-sialitski commented 6 days ago

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 commented 6 days ago

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