Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46618

[JDK9] Illegal reflective access from jenkins core

    Details

    • Similar Issues:

      Description

      While exploring Jenkins 2.60.3 on Oracle Java 9 build 181 (pre-release), it reports illegal access exceptions and warns that a future release of Java 9 will forbid illegal access.

      A partial stack trace shows:

      WARNING: Illegal reflective access by jenkins.ClassLoaderReflectionToolkit (file:/var/jenkins_home/war/WEB-INF/lib/jenkins-core-2.60.3.jar) to method java.lang.ClassLoader.findClass(java.lang.String)
              at jenkins.ClassLoaderReflectionToolkit.<clinit>(ClassLoaderReflectionToolkit.java:22)
              at hudson.ClassicPluginStrategy$DependencyClassLoader.findClass(ClassicPluginStrategy.java:762)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
              at jenkins.util.AntClassLoader.findBaseClass(AntClassLoader.java:1393)
              at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1076)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
              at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:506)
              at hudson.PluginManager$2$1$1.run(PluginManager.java:517)
              at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
              at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
              at jenkins.model.Jenkins$7.runTask(Jenkins.java:1090)
              at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
              at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
              at java.base/java.lang.Thread.run(Thread.java:844)
      

        Attachments

          Activity

          Hide
          ndeloof Nicolas De Loof added a comment -

          This whole thing has been introduced by https://github.com/jenkinsci/jenkins/commit/ee4e9c61491e89e7879337279bc58f85eb9048d1#diff-6fcbca8847b7ec9ab582a1a7e253a34a

          Unfortunately hack-ish and hard for us to find an alternative implementation.

          ALL calls to ClassLoaderReflectionToolkit come with alternative classic approach based on PluginManager.FAST_LOOKUP flag. So maybe simpler|safer to just remove this whole thing ? Not sure how "faster" this hack is vs plain classloader (especially if we consider the target classes will be loaded at some point, won't they ?)

           

          Show
          ndeloof Nicolas De Loof added a comment - This whole thing has been introduced by https://github.com/jenkinsci/jenkins/commit/ee4e9c61491e89e7879337279bc58f85eb9048d1#diff-6fcbca8847b7ec9ab582a1a7e253a34a Unfortunately hack-ish and hard for us to find an alternative implementation. ALL calls to ClassLoaderReflectionToolkit come with alternative classic approach based on PluginManager.FAST_LOOKUP flag. So maybe simpler|safer to just remove this whole thing ? Not sure how "faster" this hack is vs plain classloader (especially if we consider the target classes will be loaded at some point, won't they ?)  

            People

            • Assignee:
              Unassigned
              Reporter:
              markewaite Mark Waite
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: