NCDFE on io.grpc.InternalGlobalInterceptors after updating 1.48.0 -> 1.57.2

363 views
Skip to first unread message

Mike Yawn

unread,
Aug 18, 2023, 10:31:35 AM8/18/23
to grpc.io
I have a demo program that shows building microservices with Hazelcast + gRPC that works fine using gRPC 1.48.0.

My build system advised that due to CVEs I should upgrade, so I moved to 1.57.2.  Modules upgraded are grpc-netty-shaded (this is the one where the CVE was reported) as well as grpc-stub, grpc-protobuf, and protobuf-java (which was upgraded from 3.21.1 to 3.21.7).

After the upgrade, the server startup fails with the following stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: io/grpc/InternalGlobalInterceptors
at io.grpc.internal.ServerImplBuilder.getTracerFactories(ServerImplBuilder.java:252)
at io.grpc.internal.ServerImplBuilder.build(ServerImplBuilder.java:243)
at io.grpc.internal.AbstractServerImplBuilder.build(AbstractServerImplBuilder.java:217)
at org.example.grpc.GrpcServer.<init>(GrpcServer.java:42)
at org.hazelcast.msfdemo.invsvc.service.InventoryService.main(InventoryService.java:118)
Caused by: java.lang.ClassNotFoundException: io.grpc.InternalGlobalInterceptors
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more

The server startup code is:

server = Grpc.newServerBuilderForPort(port, InsecureServerCredentials.create())
.executor(Executors.newFixedThreadPool(16))
.addService(service)
.build();

Any idea what I need to change to resolve this?

Thanks!
Mike

Larry Safran

unread,
Aug 18, 2023, 1:24:23 PM8/18/23
to Mike Yawn, grpc.io
You need to add a dependency on grpc-api (or make sure that you have the 1.57.2 version of it).

This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/57071bff-d83a-4240-8d50-9fab9b18b355n%40googlegroups.com.

Mike Yawn

unread,
Aug 18, 2023, 1:39:14 PM8/18/23
to grpc.io
Thanks, I think that might be part of the problem, but I also neglected to rebuild my protobufs after updating and so older versions of grpc libraries were still getting called.  (protobufs were in separate projects and I didn't think to update the dependencies of those projects and rebuild them).

I think I'm past this now, seeing a different error but at first glance I think it's completely unrelated.

Reply all
Reply to author
Forward
0 new messages