Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When running on Java 9 post SLING-7186 startup fails due to the javax.annotation package no longer being exported by default, e.g.
org.osgi.framework.BundleException: Unable to resolve org.apache.sling.installer.core [2](R 2.0): missing requirement [org.apache.sling.installer.core [2](R 2.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation) Unresolved requirements: [[org.apache.sling.installer.core [2](R 2.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation)] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4149) at org.apache.felix.framework.Felix.startBundle(Felix.java:2119) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1373) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) at java.base/java.lang.Thread.run(Thread.java:844)
The interesting part here is that the javax.annotation classes that are required - for instance javax.annotation.CheckForNull are not part of the JDK-provided javax.annotation package, they must come from another jar. In fact, we don't have that Jar deployed in the starter, but instead the JDK provides:
Generated.class PostConstruct.class PreDestroy.class Resource.class Resources.class
In a sense, this is very close to the root cause of SLING-7135 - solving one might solve both but the symptoms are very different so raising it separately.
Attachments
Issue Links
- blocks
-
SLING-7235 Remove requirement for --add-modules java.se.ee
- Closed
- is blocked by
-
SLING-7798 Switch from JSR-305 annotations to JetBrains Nullable/NotNull annotations
- Closed