Pre-check

  • [x] I am sure that all the content I provide is in English.

Search before asking

  • [x] I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo Java 3.3.5 Jdk 1.8

Steps to reproduce this issue

Let service extends the stub base class (e.g., DubboGreeterServiceTriple.GreeterServiceImplBase), which is the method described in the official documentation for Dubbo Triple services

Image

What you expected to happen

I found that this problem does not occur if the service class directly implements the service interface (e.g., implements GreeterService) in dubbo-demo.

However, if the service extends the stub base class (e.g., DubboGreeterServiceTriple.GreeterServiceImplBase), which is the method described in the official documentation for Dubbo Triple services, it returns a 404 error whenever a lowerCamelCase method or an UpperCamelCase method is called.

Image

After debugging the source code, I found that the root cause is related to how Dubbo registers HTTP routes for Triple services.

When a service extends the generated base class, Dubbo uses a StubServiceDescriptor. org/apache/dubbo/config/ServiceConfig.java:565 Image

This descriptor stores method names using the original names from the .proto file, which are typically UpperCamelCase (e.g., SayHello).

Image

However, the actual method generated in the Java base class follows Java conventions and is lowerCamelCase (e.g., sayHello).

Image

When DefaultRequestMappingRegistry attempts to create HTTP mappings, it reflects on the service implementation and uses the method name (lowerCamelCase) to look up its corresponding ServiceDescriptor. This lookup fails because the registry is searching for a descriptor by its lowerCamelCase name, but the descriptor is keyed by the UpperCamelCase name.

Image

As a result, no HTTP mapping is registered for the method, causing all HTTP-based invocations to fail with a 404 error.

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • [ ] Yes I am willing to submit a pull request on my own!

Code of Conduct

Comment From: WangzJi

Hi there! 👋

I noticed that this issue is marked help wanted, and I’m very interested in contributing. I’ve previously submitted and had multiple PRs merged into open-source projects like Apache Seata and DB-GPT, and I’m excited to get involved with Dubbo as well.

If this issue isn’t urgent, I’d be happy to take it on and work through it at a steady pace. Feel free to assign it to me if that works!

Comment From: zrlw

If this issue isn’t urgent, I’d be happy to take it on and work through it at a steady pace. Feel free to assign it to me if that works!

As for me, it isn't urgent.
@paxxie2 had made a PR https://github.com/apache/dubbo/pull/15412 but it contains many unrelated contents needed to be removed, but it seemed that he has not responded for a while.