Generated OuterClass has a lot of incompatibilities !

90 views
Skip to first unread message

smal...@gmail.com

unread,
Sep 26, 2016, 11:51:04 AM9/26/16
to grpc.io
Hi , I am new to gRPC / protobuf.
This is my first .proto file :

syntax = "proto3";
option java_package = "destiny.identity.services.grpc";

service EchoService {
rpc echo (EchoRequest) returns (EchoReply) {}
}

message EchoRequest {
string name=1;
}

message EchoReply {
string message = 1;
}

It is simple , but the generated EchoServiceOuterClass.java has a lot of incompatibilities :

~/destiny-identity/target/generated-sources/protobuf/java/destiny/identity/services/grpc/EchoServiceOuterClass.java
Error:(83, 13) java: incompatible types: java.io.IOException cannot be converted to java.lang.String
Error:(152, 18) java: memoizedSize has private access in com.google.protobuf.AbstractMessage
Error:(159, 7) java: memoizedSize has private access in com.google.protobuf.AbstractMessage
Error:(394, 18) java: cannot find symbol
  symbol:   method unwrapIOException()
  location: variable e of type com.google.protobuf.InvalidProtocolBufferException
Error:(586, 13) java: incompatible types: java.io.IOException cannot be converted to java.lang.String
Error:(655, 18) java: memoizedSize has private access in com.google.protobuf.AbstractMessage
Error:(662, 7) java: memoizedSize has private access in com.google.protobuf.AbstractMessage
Error:(897, 18) java: cannot find symbol
  symbol:   method unwrapIOException()
  location: variable e of type com.google.protobuf.InvalidProtocolBufferException

This is my [ partial ] pom.xml

<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<!--
The version of protoc must match protobuf-java. If you don't depend on
protobuf-java directly, you will be transitively depending on the
protobuf-java version that grpc depends on.
-->
<protocArtifact>com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.0.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>

The grpc-netty , grpc-protobuf , grpc-stub are all of version of 1.0.0

Where goes wrong here ?
Thanks.

Eric Anderson

unread,
Sep 28, 2016, 3:06:52 PM9/28/16
to grpc.io
This was resolved in https://github.com/grpc/grpc-java/issues/2300. There was an older protobuf getting included in the application, which was causing trouble.
Reply all
Reply to author
Forward
0 new messages