missing class after compiling proto buff

219 views
Skip to first unread message

Hüsnü Ayaz

unread,
Jul 26, 2023, 3:55:53 PM7/26/23
to grpc.io
hi everyone. I'm a student. I'm learning protobuff. But I have some problems. I have created a basic proto file. there are 2 message and 1 service insade of it. Hellorequest and  Helloresponse and Hello service. 

I'm using this command for compile.
protoc --java_out=DataLink_Parser/backend/src/main/java/com/backend DataLink_Parser/backend/src/main/java/com/backend/HelloService.proto
Hellorequest and  Helloresponse java classes is crated and also Hellorequestorbuild.java ,
Helloresponseorbuild.java and last HelloServiceOuterClass.java files created. 5 in total.

HelloServiceImplBase I need this class. But it's not created. Can you help me with this?

sanjay...@google.com

unread,
Jul 26, 2023, 4:37:32 PM7/26/23
to grpc.io
Did you check  HelloServiceOuterClass.java? HelloServiceImplBase must be present as an inner class there. 

Hüsnü Ayaz

unread,
Jul 26, 2023, 4:44:17 PM7/26/23
to grpc.io

I check there. Unfortunately, there is no class named HelloServiceImplBase. Someone says in stackoverflow  It sounds like you're building the protos but not the gRPC parts. And says use this command below
protoc --grpc-java_out=DataLink_Parser/backend/src/main/java/com/backend DataLink_Parser/backend/src/main/java/com/backend/HelloService.proto
but it gives this eror.
protoc-gen-grpc-java: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.
I tried to add plugin and depandecy in my maven project. I use vs code and update my pom file but it gives same eror.
26 Temmuz 2023 Çarşamba tarihinde saat 23:37:32 UTC+3 itibarıyla sanjay...@google.com şunları yazdı:

sanjay...@google.com

unread,
Aug 16, 2023, 1:42:03 PM8/16/23
to grpc.io
Please follow the instructions at https://github.com/grpc/grpc-java/blob/master/COMPILING.md#how-to-build-code-generation-plugin to make sure you get the code generation plugin
Reply all
Reply to author
Forward
0 new messages