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

3.1.7 OSGi bundle issue #5661

Closed
paulrutter opened this issue May 24, 2024 · 12 comments
Closed

3.1.7 OSGi bundle issue #5661

paulrutter opened this issue May 24, 2024 · 12 comments

Comments

@paulrutter
Copy link

paulrutter commented May 24, 2024

When trying to bundle Jersey 3.1.7 as compile dependency in an OSGi bundle via the maven-bundle-plugin (5.1.9, latest), the following error occurs. This didn’t happen with 3.1.6.

Maven version 3.9.x
Command: mvn clean install
Java version 21.1 (corretto)

build	24-May-2024 18:40:01	[ERROR] Bundle com.abc:jersey-bundle:bundle:55.0-SNAPSHOT : Classes found in the wrong directory: {META-INF/versions/21/org/glassfish/jersey/innate/VirtualThreadSupport$NonLoomishExecutors.class=org.glassfish.jersey.innate.VirtualThreadSupport$NonLoomishExecutors, META-INF/versions/21/org/glassfish/jersey/innate/virtual/LoomishExecutors.class=org.glassfish.jersey.innate.virtual.LoomishExecutors, META-INF/versions/21/org/glassfish/jersey/innate/VirtualThreadSupport$Java21LoomishExecutors.class=org.glassfish.jersey.innate.VirtualThreadSupport$Java21LoomishExecutors, META-INF/versions/21/org/glassfish/jersey/innate/VirtualThreadSupport.class=org.glassfish.jersey.innate.VirtualThreadSupport}
build	24-May-2024 18:40:01	[ERROR] Error(s) found in bundle configuration

Did anything change in this regard or would this be an issue in the maven bundle plugin from Apache Felix?

Thanks!

@paulrutter
Copy link
Author

Maybe this instruction could help, i will try: https://bnd.bndtools.org/instructions/jpms-multi-release.html

@paulrutter
Copy link
Author

@paulrutter
Copy link
Author

There seems to be support for this, so probably not a jersey issue. See bndtools/bnd#2227

I will close it for now and try to fix it with bnd instructions in the maven bundle plugin first.

@paulrutter
Copy link
Author

Created apache/felix-dev#322

@jansupol
Copy link
Contributor

You are right, Multi-Release: true is missing in the MANIFEST.MF.

@paulrutter
Copy link
Author

paulrutter commented May 26, 2024

Right, as in, it's an issue in the maven-bundle-plugin? Or right, it's an issue in Jersey (as well)?

Because using bndlib 7.0.0 seems to work, as it supports MR jars.

@jansupol
Copy link
Contributor

It may be an issue in Jersey for certain environments depending on the Multi-Release field. Your environment may be one of them.

@paulrutter
Copy link
Author

paulrutter commented May 27, 2024

Ok, when upgrading bndlib to 7.0.0 i didn’t notice any build errors anymore though, so not sure what the issue would be then. I will try 3.1.7 in our application and let you know if it works properly or not.

We're running java 21, with Apache Felix as osgi container and Jetty 12 EE 10 btw.

@paulrutter
Copy link
Author

@jansupol I ran the feature build containing 3.1.7 this morning and although compiling and building went fine, the application doesn't start properly due to an OSGi bundle not being able to start.

org.osgi.framework.BundleException: Unable to resolve com.abc.services.openapi [53](R 53.0): missing requirement [com.abc.services.openapi [53](R 53.0)] osgi.extender; (&(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[com.abc.services.openapi [53](R 53.0)] osgi.extender; (&(osgi.extender=osgi.cdi)(version>=1.0.0)(!(version>=2.0.0)))]

I would have expected the OSGi bundle containing Jersey would fail (that one just starts properly).
Is this in line with the problems you would expect?

@jansupol
Copy link
Contributor

jansupol commented May 28, 2024

No, this looks like some other issue, osgi.cdi module of a wrong version or missing.

@paulrutter
Copy link
Author

Ok, i will investigate it further and let you know.

@paulrutter
Copy link
Author

paulrutter commented May 28, 2024

Sorry for the confusion @jansupol, that OSGi error is indeed unrelated.
After fixing that one, the application just starts properly with Jersey 3.1.7.

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

2 participants