We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Java SDK (apache/dubbo)
Dubbo Java 3.2.13 oracle jdk 1.8 window10
proto: echo.proto
echo.proto
syntax = "proto3"; package echo; option java_package = "dcloud.common"; option java_multiple_files = true; service EchoService { rpc echo (EchoRequest) returns (EchoResponse) {} rpc echo2 (EchoRequest) returns (EchoResponse) {} } message EchoRequest { string message = 1; string name = 2; } message EchoResponse { string message = 1; repeated Trace traces = 2; }
The generated code EchoServiceOuterClass class is not exists. EchoServiceOuterClass maby use Echo class replace Echo class code:
package dcloud.common; public final class Echo { private Echo() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_echo_EchoRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_echo_EchoRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_echo_EchoResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_echo_EchoResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_echo_Trace_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_echo_Trace_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\necho.proto\022\004echo\",\n\013EchoRequest\022\017\n\007mes" + "sage\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\"<\n\014EchoResponse" + "\022\017\n\007message\030\001 \001(\t\022\033\n\006traces\030\002 \003(\0132\013.echo" + ".Trace\"\025\n\005Trace\022\014\n\004host\030\001 \001(\t2p\n\013EchoSer" + "vice\022/\n\004echo\022\021.echo.EchoRequest\032\022.echo.E" + "choResponse\"\000\0220\n\005echo2\022\021.echo.EchoReques" + "t\032\022.echo.EchoResponse\"\000B\021\n\rdcloud.common" + "P\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }); internal_static_echo_EchoRequest_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_echo_EchoRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_echo_EchoRequest_descriptor, new java.lang.String[] { "Message", "Name", }); internal_static_echo_EchoResponse_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_echo_EchoResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_echo_EchoResponse_descriptor, new java.lang.String[] { "Message", "Traces", }); internal_static_echo_Trace_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_echo_Trace_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_echo_Trace_descriptor, new java.lang.String[] { "Host", }); } // @@protoc_insertion_point(outer_class_scope) }
The issue was resolved when I renamed the proto file name from echo.proto to echoService.proto
I checked the dubco-compile code and found that this might be the problem
Use the proto name when the proto file name is inconsistent with service, otherwise use service name +OuterClass
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo Java 3.2.13 oracle jdk 1.8 window10
Steps to reproduce this issue
proto:
echo.proto
The generated code
![image](https://private-user-images.githubusercontent.com/18380553/336648672-810e8a92-8bd6-46a1-808d-810d32b729c1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NDg4NzIsIm5iZiI6MTcxOTc0ODU3MiwicGF0aCI6Ii8xODM4MDU1My8zMzY2NDg2NzItODEwZThhOTItOGJkNi00NmExLTgwOGQtODEwZDMyYjcyOWMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDExNTYxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1NzgzMmQyNTE1YzllYjVlMDk0YWUyY2E2YmFhNTY4OGM2ZTEwZTM0MGZlZGZiZWZiOGE3Mzc5ZjViMGI5N2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ckTClCr6evzxReEIjlWHBB_WQcxbaVymgxhzJ49pH58)
EchoServiceOuterClass class is not exists.
EchoServiceOuterClass maby use Echo class replace
Echo class code:
The issue was resolved when I renamed the proto file name from echo.proto to echoService.proto
I checked the dubco-compile code and found that this might be the problem
![image](https://private-user-images.githubusercontent.com/18380553/336650032-c8784713-d77f-4deb-93bf-b2fb7bfe939c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NDg4NzIsIm5iZiI6MTcxOTc0ODU3MiwicGF0aCI6Ii8xODM4MDU1My8zMzY2NTAwMzItYzg3ODQ3MTMtZDc3Zi00ZGViLTkzYmYtYjJmYjdiZmU5MzljLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDExNTYxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYwZTA1MDVhZTU3MGMwMGZhYmI1NzliMzc4MDA2Nzc4NzdiMDUwYjcxMWZhYTBiYjZmMGU0MjI3Yzc2YjAwOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hK_cXgS3BtqX6mw43Wim86E4r6Xu_YqSnAHrjsuueic)
What you expected to happen
Use the proto name when the proto file name is inconsistent with service, otherwise use service name +OuterClass
Anything else
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: