zhilaohu32 opened a new issue, #15274:
URL: https://github.com/apache/dubbo/issues/15274

   ### 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](https://github.com/apache/dubbo/issues?q=is%3Aissue) 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
   
   ```java
   @RequestMapping("/test")
   public interface TestService {
   
       @GetMapping(value = "/sayHello")
       String sayHello(@RequestParam(name = "name") String name);
   
       @PostMapping(value = "/sayHello2")
       String sayHello2(@RequestBody TestVO testVO);
   }
   ```
   
   ```java
   @DubboService
   public class TestServiceImpl implements TestService{
       @Override
       public String sayHello(String name) {
           return "hello " + name;
       }
   
       @Override
       public String sayHello2(TestVO testVO) {
           return testVO.toString();
       }
   }
   ```
   
   ```java
   @RestController
   public class AbcController {
   
       @DubboReference(scope = "remote")
       private TestService t1;
   
       @GetMapping("/abc")
       public String test() {
           return t1.sayHello("name");
       }
   }
   ```
   ```
   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 't1' 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](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to