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.4 , jdk 8 , macos
Steps to reproduce this issue
I defined the service using triple-rest SpringMVC, and I had an error simulating rpc call injection
@RequestMapping("/test")
public interface TestService {
@GetMapping(value = "/sayHello")
String sayHello(@RequestParam(name = "name") String name);
@PostMapping(value = "/sayHello2")
String sayHello2(@RequestBody TestVO testVO);
}
@DubboService
public class TestServiceImpl implements TestService{
@Override
public String sayHello(String name) {
return "hello " + name;
}
@Override
public String sayHello2(TestVO testVO) {
return testVO.toString();
}
}
@RequestMapping("/serviceA")
public interface ServiceA {
@GetMapping("/test")
void test();
}
@DubboService
public class ServiceAImpl implements ServiceA{
@DubboReference(scope = "remote")
private TestService testService;
@Override
public void test() {
System.out.println(testService.sayHello("service A"));
}
}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'testService' method
org.example.dubbodemo.service.TestService#sayHello2(TestVO)
to {POST [/test/sayHello2]}: There is already 'testServiceImpl' bean method
org.example.dubbodemo.service.TestServiceImpl#sayHello2(TestVO) mapped.
What you expected to happen
It should start normally
Anything else
No response
Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct