apache / apache/eventmesh

[Bug] Netty Reflective setAccessible(true) warning under JDK11

Open
#4,676 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Java
Stars
1.8k
Forks
658
Avg merge
11h 29m
Merged PRs (30d)
52

Description

### Search before asking

- [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.

### Environment

Windows

### EventMesh version

master

### What happened

Exception stack trace was displayed when EventMesh startup.

### How to reproduce

Use JDK11 to start EventMesh.

### Debug logs

```java
2023-12-19 00:42:38,749 DEBUG [main] PlatformDependent0(PlatformDependent0.java:433) - -Dio.netty.noUnsafe: false
2023-12-19 00:42:38,749 DEBUG [main] PlatformDependent0(PlatformDependent0.java:927) - Java version: 11
2023-12-19 00:42:38,750 DEBUG [main] PlatformDependent0(PlatformDependent0.java:131) - sun.misc.Unsafe.theUnsafe: available
2023-12-19 00:42:38,751 DEBUG [main] PlatformDependent0(PlatformDependent0.java:155) - sun.misc.Unsafe.copyMemory: available
2023-12-19 00:42:38,751 DEBUG [main] PlatformDependent0(PlatformDependent0.java:193) - java.nio.Buffer.address: available
2023-12-19 00:42:38,753 DEBUG [main] PlatformDependent0(PlatformDependent0.java:267) - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.grpc.netty.shaded.io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:239) ~[grpc-netty-shaded-1.43.2.jar:1.43.2]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0.(PlatformDependent0.java:233) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.(PlatformDependent.java:93) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.(AsciiString.java:223) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.(AsciiString.java:210) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.cached(AsciiString.java:1401) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.(AsciiString.java:48) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.Utils.(Utils.java:78) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder.(NettyServerBuilder.java:83) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:40) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:25) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.ServerBuilder.forPort(ServerBuilder.java:44) [grpc-api-1.43.2.jar:1.43.2]
at org.apache.eventmesh.runtime.boot.EventMeshGrpcServer.init(EventMeshGrpcServer.java:121) [classes/:?]
at org.apache.eventmesh.runtime.boot.EventMeshGrpcBootstrap.init(EventMeshGrpcBootstrap.java:47) [classes/:?]
at org.apache.eventmesh.runtime.boot.EventMeshServer.init(EventMeshServer.java:125) [classes/:?]
at org.apache.eventmesh.runtime.boot.EventMeshStartup.main(EventMeshStartup.java:40) [classes/:?]
at org.apache.eventmesh.starter.StartUp.main(StartUp.java:25) [classes/:?]
2023-12-19 00:42:38,760 DEBUG [main] PlatformDependent0(PlatformDependent0.java:332) - java.nio.Bits.unaligned: available, true
2023-12-19 00:42:38,761 DEBUG [main] PlatformDependent0(PlatformDependent0.java:391) - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @10c8f62
at jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361) ~[?:?]
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:558) ~[?:?]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:353) ~[grpc-netty-shaded-1.43.2.jar:1.43.2]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0.(PlatformDependent0.java:344) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:294) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.(PlatformDependent.java:93) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.(AsciiString.java:223) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.(AsciiString.java:210) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.cached(AsciiString.java:1401) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.netty.util.AsciiString.(AsciiString.java:48) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.Utils.(Utils.java:78) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder.(NettyServerBuilder.java:83) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:40) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:25) [grpc-netty-shaded-1.43.2.jar:1.43.2]
at io.grpc.ServerBuilder.forPort(ServerBuilder.java:44) [grpc-api-1.43.2.jar:1.43.2]
at org.apache.eventmesh.runtime.boot.EventMeshGrpcServer.init(EventMeshGrpcServer.java:121) [classes/:?]
at org.apache.eventmesh.runtime.boot.EventMeshGrpcBootstrap.init(EventMeshGrpcBootstrap.java:47) [classes/:?]
at org.apache.eventmesh.runtime.boot.EventMeshServer.init(EventMeshServer.java:125) [classes/:?]
at org.apache.eventmesh.runtime.boot.EventMeshStartup.main(EventMeshStartup.java:40) [classes/:?]
at org.apache.eventmesh.starter.StartUp.main(StartUp.java:25) [classes/:?]
```

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) *

Contributor guide

Open the contributing guide

Research direction

Reproduce the startup path with JDK 11 and inspect the grpc-netty-shaded 1.43.2 behavior shown in the logs. Start at EventMeshGrpcServer.java:121, following EventMeshGrpcBootstrap.java, EventMeshServer.java, and EventMeshStartup.java. Done means EventMesh starts without the reported reflective-access and IllegalAccessException stack traces.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.