[jira] [Comment Edited] (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=16565603#comment-16565603 ] Julian Reschke edited comment on SLING-7312 at 8/1/18 4:59 PM: --- The script is fairly agnostic about directory structure and does not rely on svn, so it might just work for you. If you want to run it on macos, make sure you have gawk installed. It does: * rewrite Java code * rewrite POMs * tries to adjust version numbers The code works fairly well with the Oak code base (no manual edits needed), but of course that doesn't mean it might break on other examples... was (Author: reschke): The script is fairly agnostic about directory structure and does not rely on svn, so it might just work for you. If you want to run it on macos, make sure you have gawk installed. > 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)
[jira] [Comment Edited] (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=16457540#comment-16457540 ] Konrad Windszus edited comment on SLING-7312 at 5/15/18 2:54 PM: - There are some hints about this in https://blog.codefx.org/java/jsr-305-java-9/. Google is considering moving from JSR-305 to Spotbugs annotations for that reason (https://github.com/google/guava/issues/2960). Oak/Jackrabbit wants to move away as well (JCR-4301). was (Author: kwin): There are some hints about this in https://blog.codefx.org/java/jsr-305-java-9/. Google is considering moving from JSR-305 to Spotbugs annotations for that reason (https://github.com/google/guava/issues/2960). > 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)
[jira] [Comment Edited] (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=16457540#comment-16457540 ] Konrad Windszus edited comment on SLING-7312 at 4/28/18 11:16 AM: -- There are some hints about this in https://blog.codefx.org/java/jsr-305-java-9/. Google is considering moving from JSR-305 to Spotbugs annotations for that reason (https://github.com/google/guava/issues/2960). was (Author: kwin): There are some hints about this in https://blog.codefx.org/java/jsr-305-java-9/ > 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)
[jira] [Comment Edited] (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=16290682#comment-16290682 ] Konrad Windszus edited comment on SLING-7312 at 12/14/17 10:27 AM: --- Actually {{javax.annotation.CheckForNull}} is not necessary at run time (but still has a runtime retention, https://github.com/amaembo/jsr-305/blob/master/ri/src/main/java/javax/annotation/CheckForNull.java). We never deployed those classes to Sling (not even for Java 8). More details are available in https://github.com/amaembo/jsr-305/issues/31. So I am wondering, whether this particular class really is the issue here? The package though needs to be exported because otherwise OSGi will not start the bundle. was (Author: kwin): Actually {{javax.annotation.CheckForNull}} is not necessary at run time (but still has a runtime retention, https://github.com/amaembo/jsr-305/blob/master/ri/src/main/java/javax/annotation/CheckForNull.java). We never deployed those classes to Sling (not even for Java 8). So I am wondering, whether this particular class really is the issue here? The package though needs to be exported because otherwise OSGi will not start the bundle. > 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 > Fix For: Starter 10 > > > 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 (v6.4.14#64029)