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

InaccessibleObjectException since change to Java17

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • nexus-platform-plugin
    • None
    • Controller: Jenkins 2.387.3 running on Windows Server
      Agent: RHEL8 VM with Java17
      Plugin Version: 3.16.489
    • 3.16.497.vd8491dd15a_8d

      Our Pipelines are running well on Java 11 and we're starting to switch to Java 17. One issue we found is that the Nexus IQ Policy Evaluation throws an "InaccessibleObjectException", probably coming from the xstream library, here's the full error message:
      java.lang.reflect.InaccessibleObjectException: Unable to make field protected volatile java.util.Properties java.util.Properties.defaults accessible: module java.base does not "opens java.util" to unnamed module @11cbf98a
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
      at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
      at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
      at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:40)
      at com.thoughtworks.xstream.converters.collections.PropertiesConverter$Reflections.<clinit>(PropertiesConverter.java:105)

      [...]

      Caused: java.lang.ExceptionInInitializerError
      at com.thoughtworks.xstream.converters.collections.PropertiesConverter.marshal(PropertiesConverter.java:71)
      at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:68)
      at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:59)
      Is this bug a known incompatibility or do we have to change settings/parameters to make it work?

      We already tried setting Java-Options for the whole VM (see screenshot) like suggested in some threads.

      This is our call: 
      def policyEvaluation = nexusPolicyEvaluation advancedProperties: '', failBuildOnNetworkError: false, iqApplication: name, iqStage: iqStage, jobCredentialsId: redacted
       

            etita Eduard Tita
            ger_senshi Julian Krieger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: