Skip to content

Instantly share code, notes, and snippets.

@marzocchi

marzocchi/service1.proto Secret

Last active Feb 11, 2021
Embed
What would you like to do?
problematic protofiles
// save to `someservice/v1/service.proto`
syntax = "proto3";
package someservice.v1.SomeService;
message SomeMessage {
string name = 1;
}
service SomeService {
rpc SomeMethod(SomeMessage) returns (SomeMessage) {}
}
// save to `someservice/v2/service.proto`
syntax = "proto3";
package someservice.v2.SomeService;
message SomeMessage {
string name = 1;
string another_field = 2;
}
service SomeService {
rpc SomeMethod(SomeMessage) returns (SomeMessage) {}
}
> Task :compileJava FAILED
/usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java:12: error: package someservice.v1.SomeService does not exist
import someservice.v1.SomeService.SomeServiceGrpc;
                                 ^
/usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java:13: error: package someservice.v2.SomeService does not exist
import someservice.v2.SomeService.SomeServiceGrpc;
                                 ^
/usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java:18: error: package SomeServiceGrpc does not exist
    @Service class SomeService extends SomeServiceGrpc.SomeServiceImplBase {}
                                                      ^
/usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java:19: error: class Translator.SomeService is already defined in class Translator
@Service class SomeService extends SomeServiceGrpc.SomeServiceImplBase {}
         ^
/usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java:44: error: variable SomeServiceRespTypes is already defined in class Translator.WireMockTranslator
        private final Map<String, Class> SomeServiceRespTypes = new HashMap<>(){{
                                         ^
/usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java:48: error: method redirectSomeService(ProceedingJoinPoint) is already defined in class Translator.WireMockTranslator
        public void redirectSomeService(ProceedingJoinPoint jp) throws Throwable { redirect(jp, "SomeService", SomeServiceRespTypes); }
                    ^
Note: /usr/src/java-code/src/main/java/io/adven/grpc/wiremock/GrpcWiremock.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /usr/src/java-code/src/main/java/io/adven/grpc/wiremock/Translator.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s5 actionable tasks: 5 executed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment