如何为用户身份验证添加SHIRO领域请求超时?

时间:2017-05-17 11:53:05

标签: java shiro

在我的shiro.ini中,我配置了2个领域,即LDAP和JDBC

但我无法设置身份验证请求超时。

当我添加:ldapRealm.connectionTimeout = 1000 然后它抛出异常:

SEVERE: Exception sending context initialized event to listener instance of class org.apache.shiro.web.env.EnvironmentLoaderListener

org.apache.shiro.config.ConfigurationException:Property' connectionTimeout'对于com.bc.xyz.auth.efgLdapRealm类型的对象不存在。     在org.apache.shiro.config.ReflectionBuilder.isTypedProperty(ReflectionBuilder.java:413)     在org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:702)     在org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:364)     在org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:325)     在org.apache.shiro.config.ReflectionBuilder $ AssignmentStatement.doExecute(ReflectionBuilder.java:955)     在org.apache.shiro.config.ReflectionBuilder $ Statement.execute(ReflectionBuilder.java:887)     在org.apache.shiro.config.ReflectionBuilder $ BeanConfigurationProcessor.execute(ReflectionBuilder.java:765)     在org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:260)     在org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:167)     在org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:130)     在org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:108)     at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:94)     at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)     at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)     在org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)     在org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)     在org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)     在org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)     在org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)     在org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)     在org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221)     在org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133)     在org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)     在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1419)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1409)     at java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

1 个答案:

答案 0 :(得分:0)

看起来您有自定义LDAP领域,efgLdapRealm是否有setConnectionTimeout()方法?