[Java] Provide default setting of io.netty.tryReflectionSetAccessible=true
- Dominant language
- Java
- Stars
- 94
- Forks
- 152
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 11
Description
After ARROW-3191, consumers of Arrow Java with a JDK 9 and above are required to set the JVM property "io.netty.tryReflectionSetAccessible=true" at startup, each time Arrow code is run, as documented at https://github.com/apache/arrow/tree/master/java#java-properties. Not doing this will result in the error "java.lang.UnsupportedOperationException: sun.misc.Unsafe or java.nio.DirectByteBuffer.(long, int) not available", making Arrow unusable out-of-the-box.
This proposes to automatically set the property if not already set in the following steps:
1) check to see if the property io.netty.tryReflectionSetAccessible has been set
2) if not set, automatically set to "true"
3) else if set to "false", catch the Netty error and prepend the error message with the suggested setting of "true"
**Reporter**: [Bryan Cutler](https://issues.apache.org/jira/browse/ARROW-7223) / @BryanCutler
#### Related issues:
- [Document Arrow requirement in JDK9+](https://issues.apache.org/jira/browse/SPARK-29924) (relates to)
**Note**: *This issue was originally created as [ARROW-7223](https://issues.apache.org/jira/browse/ARROW-7223). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start by tracing where Arrow Java triggers the Netty reflection-access failure on JDK 9 and above; the issue does not name a source file or test. Review the documented io.netty.tryReflectionSetAccessible property behavior, then verify the unset, true, and false cases and confirm that the resulting error explains the suggested setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100