Skip to content

[Java] Illegal reflective access operation on JDK 11 #20182

@asfimport

Description

@asfimport

I'm parsing an arrow stream using the apache arrow java library 7.0.0 and I'm seeing this warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.arrow.memory.util.MemoryUtil (file:/home/ubuntu/.m2/repository/org/apache/arrow/arrow-memory-core/7.0.0/arrow-memory-core-7.0.0.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of org.apache.arrow.memory.util.MemoryUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
 

I'm running java from openjdk 11 

java --version
openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+0-adhoc..source)
OpenJDK 64-Bit Server VM (build 11.0.12+0-adhoc..source, mixed mode)
 

When moving to openjdk 17 I'm no longer able to run my code and I'm seeing this error 

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 @315ea6a7
    at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:354)
    at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:297)
    at java.lang.reflect.Field.checkCanSetAccessible (Field.java:178)
    at java.lang.reflect.Field.setAccessible (Field.java:172)
    at org.apache.arrow.memory.util.MemoryUtil.<clinit> (MemoryUtil.java:84)
    at org.apache.arrow.memory.ArrowBuf.getDirectBuffer (ArrowBuf.java:228)
    at org.apache.arrow.memory.ArrowBuf.nioBuffer (ArrowBuf.java:223)
    at org.apache.arrow.vector.ipc.ReadChannel.readFully (ReadChannel.java:87)
    at org.apache.arrow.vector.ipc.message.MessageSerializer.readMessageBody (MessageSerializer.java:727)
    at org.apache.arrow.vector.ipc.message.MessageChannelReader.readNext (MessageChannelReader.java:67)
    at org.apache.arrow.vector.ipc.ArrowStreamReader.loadNextBatch (ArrowStreamReader.java:145)
... 

 

Environment: Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
Reporter: helmi
Assignee: David Dali Susanibar Arce / @davisusanibar

Related issues:

Note: This issue was originally created as ARROW-16129. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions