Skip to content

spring-boot-starter: configuration binding fails with Jackson 2.21 #150

Open

Description

@JingkaiTang

Using tRPC-Java 2.0.5 on the JDK17/Springboot3 line with Jackson Databind 2.21.4 fails when TRpcConfigurationBindResult initializes.

Reproduction

Set the Jackson runtime to core/databind 2.21.4 and annotations 2.21, then convert a configuration object without starting a Spring context or RPC server:

TRpcConfigurationProperties properties = new TRpcConfigurationProperties();
properties.getGlobal().setEnvName("test-env");
Map<String, Object> result = new TRpcConfigurationBindResult(properties).toMap();

Expected: the global configuration contains env_name=test-env.

Actual: class initialization fails with java.lang.NoSuchFieldError: SNAKE_CASE, because the binder references the removed PropertyNamingStrategy.SNAKE_CASE field.

The proposed fix uses PropertyNamingStrategies.SNAKE_CASE, preserving snake_case configuration keys and extension-map keys. It does not require a Jackson version bump in tRPC itself.

Reproduced on macOS/aarch64 with Amazon Corretto 17.0.20.1 and 21.0.5. The unchanged implementation passes the same two regression tests with Jackson 2.15.2 and 2.18.2 but fails with 2.21.4. The proposed implementation passes all three versions. These checks cover configuration conversion only.

Related pull request: #151 (target: JDK17/Springboot3).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions