spring-projects / spring-projects/spring-grpc

ImplBase for services not generated with spring boot 4.1.1.

Open
#433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
413
Forks
95
Avg merge
4d 6h
Merged PRs (30d)
2

Description

Steps to reproduce:

  1. generate a simple spring boot project with intellij idea:
plugins {
    java
    id("org.springframework.boot") version "4.1.1"  // works by changing this to 4.1.0
    id("io.spring.dependency-management") version "1.1.7"
    id("com.google.protobuf") version "0.9.6"
}

group = "com.example"
version = "0.0.1-SNAPSHOT"
description = "demo411"

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(25)
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-grpc-server")
    testImplementation("org.springframework.boot:spring-boot-starter-grpc-server-test")
    testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.withType<Test> {
    useJUnitPlatform()
}

  1. write a simple proto service
syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.example.grpc_test.proto";
option java_outer_classname = "HelloWorldProto";

// The greeting service definition.
service Simple {
  // Sends a greeting
  rpc SayHello(HelloRequest) returns (HelloReply) {}
  rpc StreamHello(HelloRequest) returns (stream HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}
  1. the following code failed to compile becuase SimpleImplBase is not generated
import com.example.grpc_test.proto.SimpleGrpc;
class MyImpl extends SimpleGrpc.SimpleImplBase {

}
  1. 4.1.1 left, 4.1.0 right
Image Image

demo code

Environment info

I'm on macos aarch64, jdk is openjdk-25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Gradle configuration and the generated SimpleGrpc class in the linked demo project, comparing output from Spring Boot 4.1.1 and 4.1.0. Reproduce the compilation failure with MyImpl and identify why SimpleImplBase is absent in 4.1.1; done means the service base class is generated and the example compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.