Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java21 + grpc 1.63.0 ServerBuilder.forPort() function error #11198

Closed
mengqing20101212 opened this issue May 11, 2024 · 4 comments
Closed

Java21 + grpc 1.63.0 ServerBuilder.forPort() function error #11198

mengqing20101212 opened this issue May 11, 2024 · 4 comments

Comments

@mengqing20101212
Copy link

mengqing20101212 commented May 11, 2024

EBUG|2024-05-11 14:13:10,249 +0800|io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0|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.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0$5.run(PlatformDependent0.java:293) ~[grpc-netty-shaded-1.63.0.jar:1.63.0]
	at java.security.AccessController.doPrivileged(AccessController.java:319) ~[?:?]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:286) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:331) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:86) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.<init>(AsciiString.java:225) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.<init>(AsciiString.java:212) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.cached(AsciiString.java:1403) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.<clinit>(AsciiString.java:48) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.Utils.<clinit>(Utils.java:80) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder.<clinit>(NettyServerBuilder.java:83) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:40) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:25) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.ServerBuilder.forPort(ServerBuilder.java:44) [grpc-api-1.63.0.jar:1.63.0]
	at com.tiktaalik.gs.GrpcServer.initGrpcServer(GrpcServer.java:89) [classes/:?]



DEBUG|2024-05-11 14:13:10,322 +0800|io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0|jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @470734c3
	at jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:394) ~[?:?]
	at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:714) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:571) ~[?:?]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0$7.run(PlatformDependent0.java:429) ~[grpc-netty-shaded-1.63.0.jar:1.63.0]
	at java.security.AccessController.doPrivileged(AccessController.java:319) ~[?:?]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:420) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:331) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:86) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.<init>(AsciiString.java:225) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.<init>(AsciiString.java:212) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.cached(AsciiString.java:1403) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.netty.util.AsciiString.<clinit>(AsciiString.java:48) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.Utils.<clinit>(Utils.java:80) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder.<clinit>(NettyServerBuilder.java:83) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:40) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider.builderForPort(NettyServerProvider.java:25) [grpc-netty-shaded-1.63.0.jar:1.63.0]
	at io.grpc.ServerBuilder.forPort(ServerBuilder.java:44) [grpc-api-1.63.0.jar:1.63.0]
	at com.tiktaalik.gs.GrpcServer.initGrpcServer(GrpcServer.java:89) [classes/:?]

What version of gRPC-Java are you using?

What is your environment?

java21

What did you expect to see?

What did you see instead?

Steps to reproduce the bug

@ejona86
Copy link
Member

ejona86 commented May 12, 2024

These are DEBUG logs. Did anything actually go wrong?

@mengqing20101212
Copy link
Author

no, I just saw the exception being thrown, so I came to ask if it's caused by Java 21

@kannanjgithub
Copy link
Contributor

kannanjgithub commented May 13, 2024

It is just debugging logging to record why direct buffer constructor could not be used in the Netty library. Reg the first stacktrace for example, Netty code has different control flows for when direct buffer constructor is available vs not available, and it should not have any impact on the functionality.
It looks like this log would be seen for any Java version 9 or above based on the check here.

@mengqing20101212
Copy link
Author

ok , I know , Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants