[
https://issues.apache.org/jira/browse/GEODE-9474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Owen Nichols closed GEODE-9474.
-------------------------------
> the Geode offheap feature will fail on java 16
> ----------------------------------------------
>
> Key: GEODE-9474
> URL: https://issues.apache.org/jira/browse/GEODE-9474
> Project: Geode
> Issue Type: Bug
> Components: offheap
> Reporter: Darrel Schneider
> Priority: Major
> Labels: Java16, Java17
> Fix For: 1.15.0
>
>
> In two different places geode offheap calls setAccessible. In one place it is
> to call the "address" method. In the other it is to call the DIrectByteBuffer
> constructor that passes an address in to the constructor. These will not work
> on java 16 and later because it calls Method.setAccessible which is not
> allowed under normal conditions starting with java 16 (see:
> https://softwaregarden.dev/en/posts/new-java/illegal-access-in-java-16 ).
> To workaround this failure set the JVM command line option:
> --illegal-access=permit or use --add-opens.
> The places that make the calls:
> *
> org.apache.geode.internal.offheap.AddressableMemoryManager#getDirectByteBufferAddress
> *
> org.apache.geode.internal.offheap.AddressableMemoryManager#createDirectByteBuffer
> The "address" call does not need to use reflection and setAccessible but can
> instead do it with casting. See
> org.apache.geode.unsafe.internal.sun.nio.ch.DirectBuffer for how this is done.
> The constructor issue is a bigger problem. This constructor can be called
> from JNI NewDirectByteBuffer but needing to add native code to geode does not
> seem worth the trouble. If some other solution can not be found then the
> above workaround would need to be used if offheap is.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)