原可用的版本:1.r.62
升级后的版本:1.r.66
代码:
"shiroAuthzRealms": {
"type": "java.util.ArrayList",
"args":[{
"refer": "shiroAuthzRealm"
}]
},
"modularRealmAuthenticator": {
"type": "org.apache.shiro.authc.pam.ModularRealmAuthenticator",
"fields": {
"realms": {
"ref": "shiroAuthzRealms"
}
}
},
"shiroSecurityManager": {
"type": "org.apache.shiro.web.mgt.DefaultWebSecurityManager",
"fields": {
"authenticator": {
"ref": "modularRealmAuthenticator"
}
}
}
异常:
java.lang.RuntimeException: Fail to set '{ref=modularRealmAuthenticator}'[ {ref=modularRealmAuthenticator} ] by setter org.apache.shiro.mgt.AuthenticatingSecurityManager.'setAuthenticator()' because [org.nutz.lang.born.BorningException: Fail to born or cast to 'org.apache.shiro.authc.Authenticator'
by args: []
because: No suitable Constructor or Factory Method!!]: Fail to born or cast to 'org.apache.shiro.authc.Authenticator'
by args: []
because: No suitable Constructor or Factory Method!!
org.nutz.lang.Lang.wrapThrow(Lang.java:170)
org.nutz.lang.inject.InjectBySetter.inject(InjectBySetter.java:62)
org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:33)
org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
nvc.web.NutFilterDelegate.internalInit(NutFilterDelegate.java:37)
nvc.web.NutFilterDelegate.doFilter(NutFilterDelegate.java:31)
Root Cause
org.nutz.castor.FailToCastObjectException: Fail to cast from <java.util.HashMap> to <org.apache.shiro.authc.Authenticator> for {{ref=modularRealmAuthenticator}}
org.nutz.castor.Castors.cast(Castors.java:263)
org.nutz.castor.Castors.castTo(Castors.java:317)
org.nutz.lang.inject.InjectBySetter.inject(InjectBySetter.java:46)
org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:33)
org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
nvc.web.NutFilterDelegate.internalInit(NutFilterDelegate.java:37)
nvc.web.NutFilterDelegate.doFilter(NutFilterDelegate.java:31)
Root Cause
org.nutz.lang.born.BorningException: Fail to born or cast to 'org.apache.shiro.authc.Authenticator'
by args: []
because: No suitable Constructor or Factory Method!!
org.nutz.lang.Mirror.born(Mirror.java:1020)
org.nutz.lang.Lang.map2Object(Lang.java:1175)
org.nutz.castor.castor.Map2Object.cast(Map2Object.java:14)
org.nutz.castor.castor.Map2Object.cast(Map2Object.java:9)
org.nutz.castor.Castors.cast(Castors.java:253)
org.nutz.castor.Castors.castTo(Castors.java:317)
org.nutz.lang.inject.InjectBySetter.inject(InjectBySetter.java:46)
org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:33)
org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
nvc.web.NutFilterDelegate.internalInit(NutFilterDelegate.java:37)
nvc.web.NutFilterDelegate.doFilter(NutFilterDelegate.java:31)