You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "cfmcgrady (via GitHub)" <gi...@apache.org> on 2023/07/04 17:28:42 UTC

[GitHub] [incubator-celeborn] cfmcgrady commented on pull request #1677: [CELEBORN-763] Add --add-opens to bootstrap shell scripts

cfmcgrady commented on PR #1677:
URL: https://github.com/apache/incubator-celeborn/pull/1677#issuecomment-1620562041

   FYI:
   
   [JEP 403](https://openjdk.java.net/jeps/403) targeted for [JDK 17](https://openjdk.java.net/projects/jdk/17/) will remove `--illegal-access` flag. That will be equivalent to `--illegal-access=deny`.
   
   this means using reflection to invoke protected methods of exported `java.*` APIs will no longer work. For example:
   
   ```shell
   > /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/jshell
   |  欢迎使用 JShell -- 版本 17.0.7
   |  要大致了解该版本, 请键入: /help intro
   
   jshell> java.nio.ByteBuffer direct = java.nio.ByteBuffer.allocateDirect(1);
   direct ==> java.nio.DirectByteBuffer[pos=0 lim=1 cap=1]
   
   jshell> direct.getClass().getDeclaredConstructor(long.class, int.class).setAccessible(true);
   |  异常错误 java.lang.reflect.InaccessibleObjectException:Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to unnamed module @34c45dca
   |        at AccessibleObject.checkCanSetAccessible (AccessibleObject.java:354)
   |        at AccessibleObject.checkCanSetAccessible (AccessibleObject.java:297)
   |        at Constructor.checkCanSetAccessible (Constructor.java:188)
   |        at Constructor.setAccessible (Constructor.java:181)
   |        at (#2:1)
   
   jshell>
   
   ```
   
   
   ```shell
   >  /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/jshell -R --add-opens=java.base/java.nio=ALL-UNNAMED
   |  欢迎使用 JShell -- 版本 17.0.7
   |  要大致了解该版本, 请键入: /help intro
   
   jshell> java.nio.ByteBuffer direct = java.nio.ByteBuffer.allocateDirect(1);
   direct ==> java.nio.DirectByteBuffer[pos=0 lim=1 cap=1]
   
   jshell> direct.getClass().getDeclaredConstructor(long.class, int.class).setAccessible(true);
   
   jshell>
   ```


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org