[
https://issues.apache.org/jira/browse/HDDS-11392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
István Fajth resolved HDDS-11392.
---------------------------------
Fix Version/s: 1.5.0
Resolution: Fixed
> ChecksumByteBufferImpl's static initializer fails with java 17+
> ---------------------------------------------------------------
>
> Key: HDDS-11392
> URL: https://issues.apache.org/jira/browse/HDDS-11392
> Project: Apache Ozone
> Issue Type: Sub-task
> Affects Versions: 1.4.0
> Reporter: István Fajth
> Assignee: István Fajth
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.5.0
>
>
> ChecksumByteBufferImpl's static initializer fails with:
> {code}
> ava.lang.reflect.InaccessibleObjectException: Unable to make field boolean
> java.nio.ByteBuffer.isReadOnly accessible: module java.base does not "opens
> java.nio" to unnamed module @46d56d67
> 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
> org.apache.hadoop.ozone.common.ChecksumByteBufferImpl.<clinit>(ChecksumByteBufferImpl.java:51)
> {code}
> This exception appears with Java 17 and above as I tested it, it works for
> Java 9 and 11, however there is a way (according to the comment in the
> initializer) in Java 9 which we can use and which is identical to what we are
> doing with setting the field in Java 8.
> So I propose to use that from Java 9, and do not try to set the isReadOnly
> field accessible after Java 8.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]