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

jakarta.activation-api 1.2.2 can't be used as OSGi bundle under JDK8 #67

Open
grgrzybek opened this issue Mar 23, 2021 · 5 comments
Open

Comments

@grgrzybek
Copy link

Describe the bug
jakarta.activation/jakarta.activation-api/1.2.2 contains this OSGi header:

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9.0))"

To Reproduce
Steps to reproduce the behavior:

  1. Run Karaf under JDK8 install -s mvn:jakarta.activation/jakarta.activation-api/1.2.2
  2. See error:
karaf@root()> install -s mvn:jakarta.activation/jakarta.activation-api/1.2.2
Bundle ID: 144
Error executing command: Error installing bundles:
	Unable to start bundle mvn:jakarta.activation/jakarta.activation-api/1.2.2: org.osgi.framework.BundleException: Unable to resolve jakarta.activation-api [144](R 144.0): missing requirement [jakarta.activation-api [144](R 144.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=9.0)) Unresolved requirements: [[jakarta.activation-api [144](R 144.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=9.0))]

Expected behavior
jakarta.activation/jakarta.activation-api/1.2.2 is JPMS module, but the code itself doesn't require JDK9+. So this jar/bundle should be compatible with JDK8.

grgrzybek added a commit to grgrzybek/jaf that referenced this issue Mar 23, 2021
…der for JDK8 compatibility

Signed-off-by: Grzegorz Grzybek <[email protected]>
@grgrzybek
Copy link
Author

If accepted, it'd be nice to have jakarta.activation-api/1.2.3 released as well.

@lukasj
Copy link
Contributor

lukasj commented Mar 26, 2021

at runtime, one has to use com.sun.activation:jakarta.activation artifact. The api one will be kind of broken in OSGi as well as on JPMS, since implementation classes, on which the API depends, are not available there. The only use-case for current API artifact is compile-time on JDK 8, or JDK 9+ if JPMS is not used (thus in classpath mode only)

@grgrzybek
Copy link
Author

The fix applies both to the api (jakarta.activation:jakarta.activation-api) and full com.sun.activation:jakarta.activation) and the Require-Capability is what prevents from running any of the OSGi bundles on JDK8.

@grgrzybek
Copy link
Author

To provide some background, this issue is one of similar issues created during my review of Eclipse-EE4J APIs:

@vaidsandeep
Copy link

vaidsandeep commented Apr 21, 2022

should work by updating Require-Capability to
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

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

3 participants