Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tycho P2 resolution fails with 2.5.0 #341

Closed
sbouchet opened this issue Oct 19, 2021 · 20 comments
Closed

Tycho P2 resolution fails with 2.5.0 #341

sbouchet opened this issue Oct 19, 2021 · 20 comments
Milestone

Comments

@sbouchet
Copy link

Hi,

while moving our builds to tycho 2.5.0, one of them suddenly fails with an Unresolved Requirement error :
Unresolved requirement: Import-Package: javax.servlet; version="[3.1.0,4.0.0)"

I tried multiple changes locally but still have this error ( like directly use the javax.servlet bundle )
It was working on tycho 2.4.0. I'm not sure what changed in the resolver since 2.4, and why it's only failing on this build only.

here is the falling PR: jbosstools/jbosstools-livereload#147

and here is the working one: jbosstools/jbosstools-livereload#148

@laeubi
Copy link
Member

laeubi commented Oct 19, 2021

Can you give more context (e.g. link to the bundle source code that fails the resolution?) Tycho 2.5.0 has some improvements for complex setups, but maybe your case is not covered well, but maybe your bundle simply missing a requirement?

@mickaelistria
Copy link
Contributor

mickaelistria commented Oct 19, 2021 via email

@sbouchet
Copy link
Author

to reproduce, you can use the above repo ( jbosstools-livereload ) and just run mvn package on root. it will fails with the above error. the workaround is to use tycho 2.4 ( and use -DtychoVersion=2.4.0) to make it pass or remove the test bundle from reactor.

It's a very simple example the consist of 2 bundles, core and UI, and a test.
what is falling is the resolution of the test bundle, before any phase ( so during target resolution ).
the stack says test cannot be resolved because of the core that depends of jetty.servlets that depends of javax.servlet 3.1.0. but tycho does not fails to resolve the core itself...
javax.servlet is referenced the same way in both MANIFEST.MF via require-import, with only a minimal 3.1.0 version.

if I change the range to exclude 4.0, like jetty , it fails
if I use require-bundle, it fails

@mickaelistria
Copy link
Contributor

Non-resolvable parent POM for org.jboss.tools:livereload:1.5.200-SNAPSHOT: Could not transfer artifact org.jboss.tools:parent:pom:4.21.1.AM1-SNAPSHOT from/to jbosstools-base (${jbosstools-base-site}): Cannot access ${jbosstools-base-site} with type p2 using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 5, column 10

Can you please try to build a simpler example? Eg a single plugin module with just the necessary content in the MANIFEST.MF to make it fail + an appropriate .target file.

@sbouchet
Copy link
Author

my bad, you must use our specific settings to configure the repo where the parent/tp are located :

sbouchet@sbouchet:tycho_issue$ git clone https://github.com/jbosstools/jbosstools-build-ci.git
Clonage dans 'jbosstools-build-ci'...
remote: Enumerating objects: 3918, done.
remote: Counting objects: 100% (143/143), done.
remote: Compressing objects: 100% (127/127), done.
remote: Total 3918 (delta 86), reused 51 (delta 16), pack-reused 3775
Réception d'objets: 100% (3918/3918), 2.24 Mio | 6.01 Mio/s, fait.
Résolution des deltas: 100% (2572/2572), fait.
sbouchet@sbouchet:tycho_issue$ git clone https://github.com/jbosstools/jbosstools-livereload.git
Clonage dans 'jbosstools-livereload'...
remote: Enumerating objects: 4073, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 4073 (delta 40), reused 53 (delta 18), pack-reused 3977
Réception d'objets: 100% (4073/4073), 5.31 Mio | 2.30 Mio/s, fait.
Résolution des deltas: 100% (1825/1825), fait.
sbouchet@sbouchet:tycho_issue$ cd jbosstools-livereload/
sbouchet@sbouchet:jbosstools-livereload [master]$ mvn package -s ../jbosstools-build-ci/maven-settings.xml 
[INFO] Scanning for projects...
Downloading from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/maven-metadata.xml
Downloading from jboss-releases: https://repository.jboss.org/nexus/content/repositories/releases/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/maven-metadata.xml
Downloaded from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/maven-metadata.xml (608 B at 433 B/s)
[WARNING] Could not transfer metadata org.jboss.tools:parent:4.21.1.AM1-SNAPSHOT/maven-metadata.xml from/to jbosstools-base (${jbosstools-base-site}): Cannot access ${jbosstools-base-site} with type p2 using the available connector factories: BasicRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.jboss.tools:parent:4.21.1.AM1-SNAPSHOT/maven-metadata.xml from/to jbosstools-server (${jbosstools-server-site}): Cannot access ${jbosstools-server-site} with type p2 using the available connector factories: BasicRepositoryConnectorFactory
Downloading from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/parent-4.21.1.AM1-20211011.103933-3.pom
Downloaded from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/parent-4.21.1.AM1-20211011.103933-3.pom (0 B at 0 B/s)
Downloading from jboss-thirdparty-releases: https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/maven-metadata.xml
Downloading from jboss-ga-repository: https://maven.repository.redhat.com/ga/org/jboss/tools/parent/4.21.1.AM1-SNAPSHOT/maven-metadata.xml
[INFO] Inspecting build with total of 10 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 10 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
Downloading from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/maven-metadata.xml
Downloading from jboss-ga-repository: https://maven.repository.redhat.com/ga/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/maven-metadata.xml
Downloading from jboss-thirdparty-releases: https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/maven-metadata.xml
Downloading from jboss-releases: https://repository.jboss.org/nexus/content/repositories/releases/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/maven-metadata.xml
Downloaded from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/maven-metadata.xml (875 B at 1.3 kB/s)
Downloading from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/jbosstools-unified-4.21.0.Final-20210920.102625-1-jbosstools-unified.target
Downloaded from jboss-snapshots-repository: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/tools/targetplatforms/jbosstools-unified/4.21.0.Final-SNAPSHOT/jbosstools-unified-4.21.0.Final-20210920.102625-1-jbosstools-unified.target (0 B at 0 B/s)
[INFO] Computing target platform for MavenProject: org.jboss.tools.livereload.plugins:org.jboss.tools.livereload.core:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/plugins/org.jboss.tools.livereload.core/pom.xml
[INFO] Fetching p2.index from https://download.jboss.org/jbosstools/photon/snapshots/builds/jbosstools-base_master/latest/all/repo/ (172B)
[INFO] Adding repository https://download.jboss.org/jbosstools/photon/snapshots/builds/jbosstools-base_master/latest/all/repo
[INFO] Fetching p2.index from https://download.jboss.org/jbosstools/photon/snapshots/builds/jbosstools-server_master/latest/all/repo/ (172B)
[INFO] Adding repository https://download.jboss.org/jbosstools/photon/snapshots/builds/jbosstools-server_master/latest/all/repo
[INFO] Resolving dependencies of MavenProject: org.jboss.tools.livereload.plugins:org.jboss.tools.livereload.core:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/plugins/org.jboss.tools.livereload.core/pom.xml
[INFO] Resolving class path of MavenProject: org.jboss.tools.livereload.plugins:org.jboss.tools.livereload.core:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/plugins/org.jboss.tools.livereload.core/pom.xml
[INFO] Computing target platform for MavenProject: org.jboss.tools.livereload.plugins:org.jboss.tools.livereload.ui:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/plugins/org.jboss.tools.livereload.ui/pom.xml
[INFO] Resolving dependencies of MavenProject: org.jboss.tools.livereload.plugins:org.jboss.tools.livereload.ui:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/plugins/org.jboss.tools.livereload.ui/pom.xml
[INFO] Resolving class path of MavenProject: org.jboss.tools.livereload.plugins:org.jboss.tools.livereload.ui:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/plugins/org.jboss.tools.livereload.ui/pom.xml
[INFO] Computing target platform for MavenProject: org.jboss.tools.livereload.tests:org.jboss.tools.livereload.test:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/tests/org.jboss.tools.livereload.test/pom.xml
[INFO] Resolving dependencies of MavenProject: org.jboss.tools.livereload.tests:org.jboss.tools.livereload.test:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/tests/org.jboss.tools.livereload.test/pom.xml
[INFO] Resolving class path of MavenProject: org.jboss.tools.livereload.tests:org.jboss.tools.livereload.test:1.5.200-SNAPSHOT @ /tmp/tycho_issue/jbosstools-livereload/tests/org.jboss.tools.livereload.test/pom.xml
[ERROR] Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle org.jboss.tools.livereload.test cannot be resolved:org.jboss.tools.livereload.test [294]
[ERROR]   Unresolved requirement: Require-Bundle: org.jboss.tools.livereload.core; bundle-version="1.0.0"
[ERROR]     -> Bundle-SymbolicName: org.jboss.tools.livereload.core; bundle-version="1.5.200.qualifier"; singleton:="true"
[ERROR]        org.jboss.tools.livereload.core [293]
[ERROR]          Unresolved requirement: Require-Bundle: org.eclipse.jetty.servlets; bundle-version="[9.4.0,9.5.0)"
[ERROR]            -> Bundle-SymbolicName: org.eclipse.jetty.servlets; bundle-version="9.4.43.v20210629"
[ERROR]               org.eclipse.jetty.servlets [195]
[ERROR]                 Unresolved requirement: Import-Package: javax.servlet; version="[3.1.0,4.0.0)"
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle org.jboss.tools.livereload.test cannot be resolved:org.jboss.tools.livereload.test [294]
  Unresolved requirement: Require-Bundle: org.jboss.tools.livereload.core; bundle-version="1.0.0"
    -> Bundle-SymbolicName: org.jboss.tools.livereload.core; bundle-version="1.5.200.qualifier"; singleton:="true"
       org.jboss.tools.livereload.core [293]
         Unresolved requirement: Require-Bundle: org.eclipse.jetty.servlets; bundle-version="[9.4.0,9.5.0)"
           -> Bundle-SymbolicName: org.eclipse.jetty.servlets; bundle-version="9.4.43.v20210629"
              org.eclipse.jetty.servlets [195]
                Unresolved requirement: Import-Package: javax.servlet; version="[3.1.0,4.0.0)"

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle org.jboss.tools.livereload.test cannot be resolved:org.jboss.tools.livereload.test [294]
  Unresolved requirement: Require-Bundle: org.jboss.tools.livereload.core; bundle-version="1.0.0"
    -> Bundle-SymbolicName: org.jboss.tools.livereload.core; bundle-version="1.5.200.qualifier"; singleton:="true"
       org.jboss.tools.livereload.core [293]
         Unresolved requirement: Require-Bundle: org.eclipse.jetty.servlets; bundle-version="[9.4.0,9.5.0)"
           -> Bundle-SymbolicName: org.eclipse.jetty.servlets; bundle-version="9.4.43.v20210629"
              org.eclipse.jetty.servlets [195]
                Unresolved requirement: Import-Package: javax.servlet; version="[3.1.0,4.0.0)"

    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getResolverState (OsgiBundleProject.java:329)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath (OsgiBundleProject.java:196)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:173)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$0 (TychoMavenLifecycleParticipant.java:147)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1632)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:127)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:502)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:488)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:178)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:105)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.osgi.framework.BundleException: Bundle org.jboss.tools.livereload.test cannot be resolved:org.jboss.tools.livereload.test [294]
  Unresolved requirement: Require-Bundle: org.jboss.tools.livereload.core; bundle-version="1.0.0"
    -> Bundle-SymbolicName: org.jboss.tools.livereload.core; bundle-version="1.5.200.qualifier"; singleton:="true"
       org.jboss.tools.livereload.core [293]
         Unresolved requirement: Require-Bundle: org.eclipse.jetty.servlets; bundle-version="[9.4.0,9.5.0)"
           -> Bundle-SymbolicName: org.eclipse.jetty.servlets; bundle-version="9.4.43.v20210629"
              org.eclipse.jetty.servlets [195]
                Unresolved requirement: Import-Package: javax.servlet; version="[3.1.0,4.0.0)"

    at org.eclipse.tycho.core.osgitools.EquinoxResolver.assertResolved (EquinoxResolver.java:510)
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.newResolvedState (EquinoxResolver.java:169)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getResolverState (OsgiBundleProject.java:326)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath (OsgiBundleProject.java:196)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:173)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$0 (TychoMavenLifecycleParticipant.java:147)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1632)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:127)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:502)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:488)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:178)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:105)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

@sbouchet
Copy link
Author

Hi again.
I created a very small project with only MANIFEST.MF that reproduces the error.
https://github.com/sbouchet/tycho_341

gist here : https://gist.github.com/sbouchet/3a3d8ca06d99d6fae009ba6cadaa10d2

@mickaelistria
Copy link
Contributor

Perfect, thanks! I'll look at it shortly.

@mickaelistria
Copy link
Contributor

The gist shows this project is failing to build with 2.4.0 already. How does it highlight a 2.5.0 specific issue?

@sbouchet
Copy link
Author

sbouchet commented Oct 21, 2021

The gist shows this project is failing to build with 2.4.0 already. How does it highlight a 2.5.0 specific issue?

? the first line is using Tycho 2.4.0 and ends as success. Then in the middle, there is the default mvn using Tycho 2.5.0 and fails.

@mickaelistria
Copy link
Contributor

Sorry, my mistake.
So a workaround is to set -Dtycho.equinox.resolver.uses=true. I'm working on minimizing the case as much as possible.

@laeubi
Copy link
Member

laeubi commented Oct 21, 2021

So a workaround is to set -Dtycho.equinox.resolver.uses=true

By the way this indicates that somewhere you are using an indirect import (e.g. javax.servlet is used but not imported) as it is a test-bundle that seems to cause the issue here, are you importing the package there?

@mickaelistria
Copy link
Contributor

FWIW, I see a different issue locally, which doesn't happen with 2.4 but happens with 2.5

org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle org.jboss.tools.tycho_341.test cannot be resolved:org.jboss.tools.tycho_341.test [192]
  Unresolved requirement: Require-Bundle: org.eclipse.jetty.security; bundle-version="[9.4.0,9.5.0)"
    -> Bundle-SymbolicName: org.eclipse.jetty.security; bundle-version="9.4.43.v20210629"
       org.eclipse.jetty.security [149]
         Unresolved requirement: Require-Capability: osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.security.Authenticator$Factory)"; resolution:="optional"; cardinality:="multiple"
         Unresolved requirement: Import-Package: org.eclipse.jetty.server; version="[9.4.43,10.0.0)"

@mickaelistria
Copy link
Contributor

For the issue I face (see previous comment), this can be reproduced with a single module and MANIFEST.MF being

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.jboss.tools.tycho_341.test;singleton:=true
Bundle-Version: 0.1.0.qualifier
Require-Bundle: org.eclipse.jetty.security;bundle-version="[9.4.0,9.5.0)",
 org.eclipse.wst.server.preview;bundle-version="1.1.102"
Bundle-RequiredExecutionEnvironment: JavaSE-11

The reason is that wst.server.preview does require Jetty 10 which this bundle requires Jetty 9.4.x.
I'm not sure what's the expected behavior here, and I'm surprised removing uses constraints suddenly make Equinox failing at building a result. It could either be a bug in Tycho 2.4 which should have been failing anyway in that case, or with Tycho 2.5 that should be successful. I really don't know.
However, on your end, a proper solution can be to just use Jetty 10. It would be trivial and overall be a positive change to use latest release. Doing that wouldn't resolve this Tycho issue, but it would be a solution on your end, without the negative impact of previously mentioned workarounds.

@sbouchet
Copy link
Author

OK, i can try to update to jetty 10 on my side, and if not possible/too complex, try out your workaround.

@sbouchet
Copy link
Author

However, on your end, a proper solution can be to just use Jetty 10. It would be trivial and overall be a positive change to use latest release. Doing that wouldn't resolve this Tycho issue, but it would be a solution on your end, without the negative impact of previously mentioned workarounds.

Hi,
I tried to move to jetty 10 and as jetty team does not provide any p2 repo, i had to add the library directly from the maven repo. Also, the api changed from 9.x to 10.x mainly around the websocket implementation, requiring code changes and tests fails debug time.

Also not related but removing jetty 9.x completly from our product is not possible, since EGit stills require it.. (see https://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.target/egit-4.21.target )

@mickaelistria
Copy link
Contributor

I tried to move to jetty 10 and as jetty team does not provide any p2 repo, i had to add the library directly from the maven repo.

Platform does contain jetty 10: https://download.eclipse.org/eclipse/updates/4.21/R-4.21-202109060500/plugins/ , you should use this repo.

@sbouchet
Copy link
Author

I tried to move to jetty 10 and as jetty team does not provide any p2 repo, i had to add the library directly from the maven repo.

Platform does contain jetty 10: https://download.eclipse.org/eclipse/updates/4.21/R-4.21-202109060500/plugins/ , you should use this repo.

yes, but it's not the whole jetty here, only the bundles needed by platform. our bundles extends websocket and it's not part of it.

@akurtakov
Copy link
Member

It's worth trying jetty/jetty.project#6403 . If this works for you and eclipse platform moves to use it too this might be the ultimate solution.

@laeubi
Copy link
Member

laeubi commented Oct 26, 2021

Require-Bundle: org.eclipse.jetty.security;bundle-version="[9.4.0,9.5.0)",

Is Require-Bundle really neccesary here?

@akurtakov
Copy link
Member

This one seems to have stalled. Thus I'm closing. Please reopen if there is still issue for you and you're ready to help with figuring it out.

@laeubi laeubi added this to the 2.7 milestone Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants