torito commented on code in PR #1008:
URL: https://github.com/apache/arrow-java/pull/1008#discussion_r2832888696


##########
memory/memory-core/src/main/java/org/apache/arrow/memory/util/MemoryUtil.java:
##########
@@ -81,9 +82,18 @@ public Object run() {
       BYTE_ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset(byte[].class);
 
       // get the offset of the address field in a java.nio.Buffer object
+      long maybeOffset;
       Field addressField = java.nio.Buffer.class.getDeclaredField("address");
-      addressField.setAccessible(true);
-      BYTE_BUFFER_ADDRESS_OFFSET = UNSAFE.objectFieldOffset(addressField);
+      try {
+        addressField.setAccessible(true);
+        maybeOffset = UNSAFE.objectFieldOffset(addressField);
+      } catch (InaccessibleObjectException e) {
+        maybeOffset = -1;

Review Comment:
   Hi, we can still use arrow and some internals, we are using it in production 
but we are maintaining a fork to be able to load the classes. Otherwise, the 
class simply does not load, and by consequence our classes are not loaded 
neither. My main problem is we cannot control the JVM and set the 
`--add-opens`, as our application is a plugin which is installed in clusters, 
where we cannot control jvm initialization, sometimes in the cloud, which is 
even more difficult to set `--add-opens`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to