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

An illegal reflective access from EnvInject plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • envinject-plugin
    • None
    • Jenkins ver. 2.218
      EnvInject API Plugin 1.7
      Environment Injector Plugin 2.3.0

      Hi,

      After starting Jenkins, there is displayed "An illegal reflective access" warning in console.

      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.jenkinsci.plugins.envinject.service.En
      vInjectMasterEnvVarsSetter to field java.lang.reflect.Field.modifiers
      WARNING: Please consider reporting this to the maintainers of org.jenkinsci.plug
      ins.envinject.service.EnvInjectMasterEnvVarsSetter
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect
      ive access operations
      WARNING: All illegal access operations will be denied in a future release

          [JENKINS-60891] An illegal reflective access from EnvInject plugin

          Pavel Kudrys created issue -
          Roman Zwi made changes -
          Comment [ Is this maybe the reason that configured ENV variables are missing on the windows agent? ]

          Gabriella added a comment - - edited

          I've run into this as well: java version openjdk-11+28_linux-x64, OS CentOS Linux release 8.2.2004 (Core). remoting jar version 4.11.2, jenkins version 2.330

          Gabriella added a comment - - edited I've run into this as well: java version openjdk-11+28_linux-x64, OS CentOS Linux release 8.2.2004 (Core). remoting jar version 4.11.2, jenkins version 2.330

          Helcio Mayor added a comment - - edited

          Is there any progress on this issue? Issue reproduced with following specification:

          WARNING: Illegal reflective access by org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter to method java.lang.Class.getDeclaredFields0(boolean)

          Jenkins 2.361.4

          java.runtime.version 11.0.14+9
          java.vendor.version Temurin-11.0.14+9
          java.vendor Eclipse Adoptium

          Environment Injector PluginVersion2.881.v37c62073ff97

          EnvInject API PluginVersion1.199.v3ce31253ed13

          Helcio Mayor added a comment - - edited Is there any progress on this issue? Issue reproduced with following specification: WARNING: Illegal reflective access by org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter to method java.lang.Class.getDeclaredFields0(boolean) Jenkins 2.361.4 java.runtime.version 11.0.14+9 java.vendor.version Temurin-11.0.14+9 java.vendor Eclipse Adoptium Environment Injector PluginVersion2.881.v37c62073ff97 EnvInject API PluginVersion1.199.v3ce31253ed13

          Joerg Schwaerzler added a comment - - edited

          I can reproduce as well. I see the following warning message displayed in the build agent connection log (SSH connection, Windows build agent, Java 11).:

          WARNING: An illegal reflective access operation has occurred
          WARNING: Illegal reflective access by org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter to method java.lang.Class.getDeclaredFields0(boolean)
          WARNING: Please consider reporting this to the maintainers of org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter
          WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
          WARNING: All illegal access operations will be denied in a future release
          

          Joerg Schwaerzler added a comment - - edited I can reproduce as well. I see the following warning message displayed in the build agent connection log (SSH connection, Windows build agent, Java 11).: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter to method java.lang. Class .getDeclaredFields0( boolean ) WARNING: Please consider reporting this to the maintainers of org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
          Basil Crow made changes -
          Link New: This issue is duplicated by JENKINS-70092 [ JENKINS-70092 ]
          Basil Crow made changes -
          Link New: This issue is duplicated by JENKINS-70100 [ JENKINS-70100 ]
          Basil Crow made changes -
          Link New: This issue is duplicated by JENKINS-70504 [ JENKINS-70504 ]
          Basil Crow made changes -
          Link New: This issue is duplicated by JENKINS-72103 [ JENKINS-72103 ]

          Same here after upgrading controller (2.414.3) and inbound agent to JDK17. Didn't appearwhen both running on Java11

          We started to see 

          java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang.Class.getDeclaredFields0(boolean) accessible: module java.base does not "opens java.lang" to unnamed module @28c6c0e9 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source) at java.base/java.lang.reflect.Method.setAccessible(Unknown Source) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.getModifiers(EnvInjectMasterEnvVarsSetter.java:29) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:55) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:19) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:377) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:127) at java.base/java.lang.Thread.run(Unknown Source) Agent successfully connected and online

          on connection logs

          Valentin Delaye added a comment - Same here after upgrading controller (2.414.3) and inbound agent to JDK17. Didn't appearwhen both running on Java11 We started to see  java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang. Class .getDeclaredFields0( boolean ) accessible: module java.base does not "opens java.lang" to unnamed module @28c6c0e9 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source) at java.base/java.lang.reflect.Method.setAccessible(Unknown Source) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.getModifiers(EnvInjectMasterEnvVarsSetter.java:29) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:55) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:19) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:377) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:127) at java.base/java.lang. Thread .run(Unknown Source) Agent successfully connected and online on connection logs

            Unassigned Unassigned
            odklizec Pavel Kudrys
            Votes:
            15 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: