[
https://issues.apache.org/jira/browse/ARROW-16449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533515#comment-17533515
]
Daniel Glöckner commented on ARROW-16449:
-----------------------------------------
[~lidavidm] I re-tested with the Arrow 8.0 release and java 17.0.2.
The minimal code below only works if I add {{--add-opens
java.base/java.nio=ALL-UNNAMED}} VM option. Is this expected?
{code}
import org.apache.arrow.memory.RootAllocator;
public class Arrow {
public static void main(String[] args) {
RootAllocator rootAllocator = new RootAllocator();
var buf = rootAllocator.buffer(1024);
System.out.println(buf);
}
}
{code}
> [Java] java.lang.reflect.InaccessibleObjectException on Java 18
> ---------------------------------------------------------------
>
> Key: ARROW-16449
> URL: https://issues.apache.org/jira/browse/ARROW-16449
> Project: Apache Arrow
> Issue Type: Bug
> Components: Java
> Affects Versions: 6.0.0
> Reporter: Daniel Glöckner
> Priority: Major
>
> Getting the following stack trace when running on Java 18.
> {{BaseAllocator}} throws this when it calls the
> {{DefaultAllocationManagerFactory}}.
> {code}
> private ArrowBuf createEmpty() {
> return this.allocationManagerFactory.empty();
> }
> {code}
> {code:java}
> Caused by: java.lang.RuntimeException: Failed to initialize MemoryUtil.
> at org.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:136)
> ... 20 more
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
> field long java.nio.Buffer.address accessible: module java.base does not
> \"opens java.nio\" to unnamed module @3453e479
> 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.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:84)
> ... 20 more
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)