-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] triple-rest dependency injection failed #15274
Comments
I can't reproduce your problem. Can you upload your project? |
|
I think removing spring-boot-starter-web and replacing it with spring-web can solve your problem.
|
Why an error occurs when spring-boot-starter-web is used? Will the problem be fixed? |
They both execute SpringMVC RequestMappingHandlerMapping. I don't think it's a Dubbo bug. We can consider optimizing it, but only as an optimization. |
I want it to be optimized. We need it. |
After communicating with others in the community, I realized that my previous explanation was incorrect, and I sincerely apologize for the misunderstanding. In fact, this error occurs because the @RequestMapping annotation is parsed by Spring's RequestMappingHandlerMapping, which causes both testServiceImpl and testService beans to be detected as duplicates. A better solution is to remove the @RequestMapping annotation from the class. |
remove the @RequestMapping annotation from the class. Unable to start after removing the @RequestMapping annotation from the class |
remove TestService @RequestMapping |
I'm sure I've removed it, but it's still an error. @RestController
public interface TestService {
@GetMapping(value = "/test/sayHello")
String sayHello(@RequestParam(name = "name") String name);
@PostMapping(value = "/test/sayHello2")
String sayHello2(@RequestBody TestVO testVO);
} |
I’m sorry.and remove @RestController |
A new error has occurred org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is java.lang.reflect.UndeclaredThrowableException |
This looks like a Spring Boot error. In fact, after removing all @RequestMapping and @RestController, it runs normally on my MacBook. |
ok,Will the problem be optimized? Make @ReqeustMapping and @RestController tagable? |
Pre-check
Search before asking
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
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?
Code of Conduct
The text was updated successfully, but these errors were encountered: