You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2018/08/01 11:26:00 UTC

[jira] [Commented] (SLING-7312) Java 9 requires javax.annotation to be added to the classpath

    [ https://issues.apache.org/jira/browse/SLING-7312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16565154#comment-16565154 ] 

Julian Reschke commented on SLING-7312:
---------------------------------------

Note that with Java 11, Sling components do not seem to load anymore:

{noformat}
01.08.2018 13:15:57.835 *ERROR* [FelixDispatchQueue] org.apache.sling.installer.core FrameworkEvent ERROR (org.osgi.framework.BundleException: Unable to resolve org.apache.sling.installer.core [12](R 12.0): missing requirement [org.apache.sling.installer.core [12](R 12.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation) Unresolved requirements: [[org.apache.sling.installer.core [12](R 12.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation)])
org.osgi.framework.BundleException: Unable to resolve org.apache.sling.installer.core [12](R 12.0): missing requirement [org.apache.sling.installer.core [12](R 12.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation) Unresolved requirements: [[org.apache.sling.installer.core [12](R 12.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation)]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4362)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2277)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1535)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.base/java.lang.Thread.run(Thread.java:834)
{noformat}

> Java 9 requires javax.annotation to be added to the classpath
> -------------------------------------------------------------
>
>                 Key: SLING-7312
>                 URL: https://issues.apache.org/jira/browse/SLING-7312
>             Project: Sling
>          Issue Type: Bug
>          Components: Launchpad
>            Reporter: Robert Munteanu
>            Priority: Major
>             Fix For: Starter 11
>
>
> When running on Java 9 post SLING-7186 startup fails due to the {{javax.annotation}} package no longer being exported by default, e.g.
> {noformat}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){noformat}
> 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:
> {noformat}
> Generated.class
> PostConstruct.class
> PreDestroy.class
> Resource.class
> Resources.class
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)