-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Enhancement] ShiroRequestMappingConfig's RequestMappingHandlerMapping dependency should be annotated with @Qualifier #1879
Comments
Any chance you can submit a PR? |
@lprimak public ShiroRequestMappingConfig(@Qualifier("requestMappingHandlerMapping") RequestMappingHandlerMapping requestMappingHandlerMapping) is this approach right? Do i need to look into anymore files? |
That's just it, I am not sure. I am not a Spring user and cannot test / verify the correctness of the solution. However, if I were to "just guess" this does look correct. If you have a good test that can prove that this works, please feel free to issue a PR, and this will be very much appreciated. Thank you! |
Fine I will work on this issue and open a pr accordingly. |
@lprimak |
There are tests in https://github.com/apache/shiro/tree/main/support/spring/src/test directory. Please look there. However I am not sure if that’s what you need. I think that integration test is what’s needed but that doesn’t exist in Shiro for Spring. I would start with a simple standalone project that demonstrates the issue and that the proposed fix fixes it. |
Ok that makes sense, I am trying to come up with a standalone project but it is getting too difficult for me because of the various dependencies which i am not generally used to. @Configuration
public class MultipleBeansConfig {
@Bean(name = "primaryHandlerMapping")
public RequestMappingHandlerMapping primaryHandlerMapping() {
return new RequestMappingHandlerMapping();
}
@Bean(name = "secondaryHandlerMapping")
public RequestMappingHandlerMapping secondaryHandlerMapping() {
return new RequestMappingHandlerMapping();
}
} this is the simple code I came up. Is there anyone who can help me out with this on how i should approach further? I have already opened a pr with the changes |
Can you be more specific? What dependencies? Can you give a link to your project? |
The shiro dependencies to be exact the shiro-aspectj and so on, I dont understand where these dependencies are coming from and hence most of my project does not seem to work, is there like a roadmap or something i can follow or anyone to guide me with how i can proceed? |
Have you been able to start with a simple example? For example https://github.com/apache/shiro/tree/main/samples/spring-boot-3-web ? |
Ok thank you i will look into this. |
Search before asking
Enhancement Request
avoid "required a single bean, but 2 were found" Exception
Describe the solution you'd like
annotated with @qualifier
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: