You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Darrel Schneider (Jira)" <ji...@apache.org> on 2021/07/27 22:19:00 UTC
[jira] [Created] (GEODE-9469) CopyHelper.copy will fail on java 16
and later when copying instances of Clonable
Darrel Schneider created GEODE-9469:
---------------------------------------
Summary: CopyHelper.copy will fail on java 16 and later when copying instances of Clonable
Key: GEODE-9469
URL: https://issues.apache.org/jira/browse/GEODE-9469
Project: Geode
Issue Type: Bug
Components: core
Reporter: Darrel Schneider
CopyHelper.copy is an API that allows geode users to make copies of objects. It is also used internally by a number of geode features. The copy-on-read region attribute is one example. If the object being copied is an instance of Cloneable then on java 16, copy will throw a RuntimeException which is an instance of java.lang.reflect.InaccessibleObjectException.
The copy code tries to catch exceptions during the clone and instead use serialization to make a copy but it does not catch RuntimeException which is what java 16 throws from setAccessible. It would be pretty easy to fix this exception handling.
The only work arounds are to not implement Cloneable or to start the jvm with the command line option: --illegal-access=permit.
See: [https://softwaregarden.dev/en/posts/new-java/illegal-access-in-java-16|https://softwaregarden.dev/en/posts/new-java/illegal-access-in-java-16/]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)