reactive-grpc: reactor fails to generate gRPC stub in latest version

Hey,

gRPC protoc reactive
1.29.0 3.12.2 1.0.1

I just updated to the latest gRPC/protoc/reactive-grpc and the compiler fails with the following message:

AdminServiceGrpc.java:[76,29] error: cannot find symbol
  symbol:   class StubFactory
  location: class AbstractStub

And the generated code:

  public static AdminServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<AdminServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<AdminServiceBlockingStub>() {
        @java.lang.Override
        public AdminServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new AdminServiceBlockingStub(channel, callOptions);
        }
      };
    return AdminServiceBlockingStub.newStub(factory, channel);
  }

I’m using this maven plugin to generate the stubs:

  <properties>
    <protobuf.version>3.12.2</protobuf.version>
    <grpc.version>1.29.0</grpc.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.6.1</version>
        <extensions>true</extensions>
        <configuration>
          <pluginId>grpc-java</pluginId>
          <protocArtifact>
            com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
          </protocArtifact>
          <pluginArtifact>
            io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
          </pluginArtifact>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>compile-custom</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

I also tried your protoc plugin, but I get the same issues.

I cannot find a table of version mapping, so I’m not sure if the versions do not match or the maven plugin doesn’t work correctly or something else. Any help is appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

@rmichela maybe we could shade io.grpc packages in reactor-grpc so that accidentally pulling it doesn’t break everything ?