apache / apache/shenyu

[BUG] ServiceProcessor imports Spring `@Service` instead of Dubbo `@Service` — old-style Dubbo beans never get beanPath

Closed Beginner friendly
#6,682 2 comments 0 reactions 0 assignees View on GitHub
client: dubbo priority: high type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- Severity: High
- Location:
`shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/ServiceProcessor.java:25` (import), `:40-42` (process); `shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/ApacheDubboApiBeansExtractor.java:21,33` (extractor uses Dubbo's `@Service`)
-
Description:
`ApacheDubboApiBeansExtractor` correctly imports `org.apache.dubbo.config.annotation.Service` (Dubbo's deprecated `@Service`) and registers it as a supported annotation. But `ServiceProcessor` imports `org.springframework.stereotype.Service` (Spring's generic `@Service`) and types itself `ApiAnnotationProcessor` with `matchAnnotation()` returning Spring's `Service.class`. A bean annotated with Dubbo's `@Service` (or `@ShenyuService` which meta-annotates it) does NOT carry Spring's `@Service`, so `ApiAnnotationProcessor.getAnnotation(apiBean)` always returns null, and `process(apiBean, annotation)` is never invoked. The beanPath is never set (stays `""` default).
-
Impact:
In the ApiBean-based extraction path, old-style `@Service`/`@ShenyuService` Dubbo beans produce metadata with missing path components (only contextPath + methodName, no service path). The gateway routes to wrong paths.
-
Suggested fix:
Change `ServiceProcessor` import from `org.springframework.stereotype.Service` to `org.apache.dubbo.config.annotation.Service`. Consider using `annotation.path()` instead of `annotation.value()` to match `DubboServiceProcessor`.
-
Confidence: High
- Related existing: none — #5815 (annotation default values), #5943 (method config) are different; this is a wrong-import bug.

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ServiceProcessor.java at the import and process locations, then compare its annotation handling with ApacheDubboApiBeansExtractor.java and the referenced DubboServiceProcessor. Verify how the extractor registers Dubbo's @Service and how annotation.path() or annotation.value() is used. Done means old-style @Service and @ShenyuService beans receive the expected beanPath instead of an empty value.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.