-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Spring boot Actuator conflicts with shiro #16097
Comments
Thanks for the report. From the information you've provided thus far, it's not clear to me that this is a problem with Spring Boot rather than with Shiro or your configuration. If you would like us to spend some time trying to help you, please spend some time to provide a minimal sample that reproduces the behaviour you have described. |
Thank you for your help, but I think I should find the problem, but the specific reason is not very clear to me, I think the following website will make you more understand my problem, by the way, can you tell me the specific reason。 |
It sounds like a bug in MyBatis that is triggering eager initialisation of some beans. If a meter binder is initialised too early it will not have a chance to bind its meters to the meter registry and they will disappear. The above is only an educated guess. Given how popular MyBatis is, I’d like to fully understand the cause so that, hopefully, it can be fixed. Could you please provide a sample that reproduces the problem? |
Thank you for taking time out of your busy schedule to deal with this problem. I think this is not a bug of mybatis, because the same problem still exists when I replace mybatis with JPA. Therefore, I think this should be shiro problem.I will provide a sample of the problem to you later |
Great. Thank you. I'll look forward to taking a look at the sample. |
Hey, wilkinsona, when I delved into this issue, I made some other findings. At first, I always thought that it was the external injection of JPA beans or Mybatis Mapper into the custom ShiroRealm that caused the problem, but when I delved into it, I found that the problem might be where to get the source data. I have written the specific instructions in the following samples. Please tell me as soon as you know the reason. Thank you very much |
Thanks for the sample. The root cause of the problem is Shiro's
In your specific case, the The underlying problem really needs to be fixed in Shiro as they should not be injecting dependencies into a @Bean
public org.apache.shiro.mgt.SecurityManager securityManager(@Lazy Realm shiroRealm) {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setRealm(shiroRealm);
return securityManager;
} |
Hey folks, |
When i use Spring Boot with shiro , Spring Boot Actuator doesnt publish jvm metric。
I use Spring Boot with Shiro , but i starting Application and navigating to /actuator/metrics displays a list of available meter names:
Just 17 items!!!
Then , i shield shiro config :
I starting Application again and i get all.
I want to use both Actuator and Shiro. Thanks for any helps.
The text was updated successfully, but these errors were encountered: