shiro报错 The bean 'authRealm' could not be injected as a 'org.fsc.MyShiro.MyRealm

qq_40301407 2018-01-08 09:55:51

////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////
2018-01-08 21:47:09.552 INFO 6912 --- [ main] org.fsc.EnterBoot : Starting EnterBoot on PC-20160923LSVW with PID 6912 (D:\Users\Administrator\eclipse-workspace\SpringBoot\target\classes started by Administrator in D:\Users\Administrator\eclipse-workspace\SpringBoot)
2018-01-08 21:47:09.552 INFO 6912 --- [ main] org.fsc.EnterBoot : No active profile set, falling back to default profiles: default
2018-01-08 21:47:09.742 INFO 6912 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@708f5957: startup date [Mon Jan 08 21:47:09 CST 2018]; root of context hierarchy
2018-01-08 21:47:13.522 INFO 6912 --- [ main] o.f.M.ShiroConfig.ShiroConfiguration : --------------(shiro生命周期)lifecycleBeanPostProcessor已经加载----------------
+++++++++++++++shiro配置被加载+++++++++++++++++++++
2018-01-08 21:47:13.788 INFO 6912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfiguration' of type [class org.fsc.MyShiro.ShiroConfig.ShiroConfiguration$$EnhancerBySpringCGLIB$$b32a6d59] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-08 21:47:14.279 INFO 6912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'myLog4jInterceptor' of type [class org.fsc.interceptor.MyLog4jInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-08 21:47:14.279 INFO 6912 --- [ main] org.fsc.interceptor.MyLog4jInterceptor : 2018-01-08 21:47:14org.fsc.MyShiro.ShiroConfig.ShiroConfiguration$$EnhancerBySpringCGLIB$$b32a6d59
2018-01-08 21:47:14.326 INFO 6912 --- [ main] o.f.M.ShiroConfig.ShiroConfiguration : --------------cacheManager已经加载----------------
2018-01-08 21:47:14.341 INFO 6912 --- [ main] org.fsc.interceptor.MyLog4jInterceptor : 2018-01-08 21:47:140
2018-01-08 21:47:16.640 INFO 6912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cacheManager' of type [class org.apache.shiro.cache.ehcache.EhCacheManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-08 21:47:16.694 INFO 6912 --- [ main] org.fsc.interceptor.MyLog4jInterceptor : 2018-01-08 21:47:16org.fsc.MyShiro.ShiroConfig.ShiroConfiguration$$EnhancerBySpringCGLIB$$b32a6d59
2018-01-08 21:47:16.694 INFO 6912 --- [ main] o.f.M.ShiroConfig.ShiroConfiguration : --------------(shiro密码比较器)credentialsMatcher已经加载----------------
2018-01-08 21:47:16.711 INFO 6912 --- [ main] o.a.shiro.cache.ehcache.EhCacheManager : Using existing EHCache named [passwordRetryCache]
2018-01-08 21:47:16.711 INFO 6912 --- [ main] org.fsc.interceptor.MyLog4jInterceptor : 2018-01-08 21:47:160
2018-01-08 21:47:16.744 INFO 6912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'credentialsMatcher' of type [class org.fsc.MyShiro.CredentialsMatcher.RetryLimitHashedCredentialsMatcher] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-08 21:47:16.761 INFO 6912 --- [ main] org.fsc.interceptor.MyLog4jInterceptor : 2018-01-08 21:47:16org.fsc.MyShiro.ShiroConfig.ShiroConfiguration$$EnhancerBySpringCGLIB$$b32a6d59
2018-01-08 21:47:16.761 INFO 6912 --- [ main] o.f.M.ShiroConfig.ShiroConfiguration : --------------authRealm已经加载----------------
MyAutoRealm+++++++++++++++++++++++++++++++++++++++++++++++++++
2018-01-08 21:47:16.777 INFO 6912 --- [ main] o.a.shiro.cache.ehcache.EhCacheManager : Cache with name 'org.fsc.MyShiro.MyRealm.MyAutoRealm.authorizationCache' does not yet exist. Creating now.
2018-01-08 21:47:16.843 INFO 6912 --- [ main] o.a.shiro.cache.ehcache.EhCacheManager : Added EhCache named [org.fsc.MyShiro.MyRealm.MyAutoRealm.authorizationCache]
2018-01-08 21:47:16.843 INFO 6912 --- [ main] org.fsc.interceptor.MyLog4jInterceptor : 2018-01-08 21:47:160
2018-01-08 21:47:16.891 INFO 6912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'authRealm' of type [class org.fsc.MyShiro.MyRealm.MyAutoRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-08 21:47:17.021 WARN 6912 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [org/fsc/MyShiro/ShiroConfig/ShiroConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizationAttributeSourceAdvisor' defined in class path resource [org/fsc/MyShiro/ShiroConfig/ShiroConfiguration.class]: Unsatisfied dependency expressed through method 'authorizationAttributeSourceAdvisor' parameter 0: Error creating bean with name 'securityManager' defined in class path resource [org/fsc/MyShiro/ShiroConfig/ShiroConfiguration.class]: Unsatisfied dependency expressed through method 'securityManager' parameter 0: Bean named 'authRealm' is expected to be of type [org.fsc.MyShiro.MyRealm.MyAutoRealm] but was actually of type [com.sun.proxy.$Proxy56]; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'authRealm' is expected to be of type [org.fsc.MyShiro.MyRealm.MyAutoRealm] but was actually of type [com.sun.proxy.$Proxy56]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityManager' defined in class path resource [org/fsc/MyShiro/ShiroConfig/ShiroConfiguration.class]: Unsatisfied dependency expressed through method 'securityManager' parameter 0: Bean named 'authRealm' is expected to be of type [org.fsc.MyShiro.MyRealm.MyAutoRealm] but was actually of type [com.sun.proxy.$Proxy56]; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'authRealm' is expected to be of type [org.fsc.MyShiro.MyRealm.MyAutoRealm] but was actually of type [com.sun.proxy.$Proxy56]
Related cause: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'shiroFilter': Requested bean is currently in creation: Is there an unresolvable circular reference?
2018-01-08 21:47:17.061 ERROR 6912 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'authRealm' could not be injected as a 'org.fsc.MyShiro.MyRealm.MyAutoRealm' because it is a JDK dynamic proxy that implements:


Action:

Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.

...全文
1141 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧