You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2019/11/21 13:59:00 UTC

[jira] [Commented] (ARROW-7223) [Java] Provide default setting of io.netty.tryReflectionSetAccessible=true

    [ https://issues.apache.org/jira/browse/ARROW-7223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16979293#comment-16979293 ] 

David Li commented on ARROW-7223:
---------------------------------

I think setting the property won't help, as it's read at static initialization time: [https://github.com/netty/netty/blob/43252a61352f2785c19e321c67d5ac87aee4d172/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L50]

It's also used afterwards in a static initialization block: [https://github.com/netty/netty/blob/43252a61352f2785c19e321c67d5ac87aee4d172/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L225] (ReflectionUtil.trySetAccessible reads the cached property value and aborts if it's unset)

We ended up patching Netty for our uses.

> [Java] Provide default setting of io.netty.tryReflectionSetAccessible=true
> --------------------------------------------------------------------------
>
>                 Key: ARROW-7223
>                 URL: https://issues.apache.org/jira/browse/ARROW-7223
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Bryan Cutler
>            Priority: Major
>
> 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"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)