java - Spring Bean not found for Spring Security RememberMe? -


in grails app spring security want initialize following spring bean in conf/spring/resource.groovy:

beans = {       if (grailsapplication.config.grails.plugins.springsecurity.rememberme.persistent) {         remembermeservices(mypersistenttokenbasedremembermeservice) {             userdetailsservice = ref('userdetailsservice')             key = grailsapplication.config.grails.plugins.springsecurity.rememberme.key             cookiename = grailsapplication.config.grails.plugins.springsecurity.rememberme.cookiename             alwaysremember = grailsapplication.config.grails.plugins.springsecurity.rememberme.alwaysremember             tokenvalidityseconds = grailsapplication.config.grails.plugins.springsecurity.rememberme.tokenvalidityseconds             parameter = grailsapplication.config.grails.plugins.springsecurity.rememberme.parameter             usesecurecookie = grailsapplication.config.grails.plugins.springsecurity.rememberme.usesecurecookie // false              tokenrepository = ref('tokenrepository')             serieslength = grailsapplication.config.grails.plugins.springsecurity.rememberme.persistenttoken.serieslength // 16             tokenlength = grailsapplication.config.grails.plugins.springsecurity.rememberme.persistenttoken.tokenlength // 16         }     }  } 

i found code here @ bottom of page.

i following error:

error context.grailscontextloader  - error initializing application: error creating bean name 'authenticationprocessingfilter': cannot resolve reference bean 'remembermeservices' while setting bean property 'remembermeservices'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'remembermeservices': initialization of bean failed; nested exception org.springframework.beans.typemismatchexception: failed convert property value of type 'groovy.util.configobject' required type 'int' property 'tokenlength'; nested exception java.lang.illegalargumentexception: cannot convert value of type [groovy.util.configobject] required type [int] property 'tokenlength': propertyeditor [org.springframework.beans.propertyeditors.customnumbereditor] returned inappropriate value of type [groovy.util.configobject] org.springframework.beans.factory.beancreationexception: error creating bean name 'authenticationprocessingfilter': cannot resolve reference bean 'remembermeservices' while setting bean property 'remembermeservices'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'remembermeservices': initialization of bean failed; nested exception org.springframework.beans.typemismatchexception: failed convert property value of type 'groovy.util.configobject' required type 'int' property 'tokenlength'; nested exception java.lang.illegalargumentexception: cannot convert value of type [groovy.util.configobject] required type [int] property 'tokenlength': propertyeditor [org.springframework.beans.propertyeditors.customnumbereditor] returned inappropriate value of type [groovy.util.configobject]     @ java.util.concurrent.executors$runnableadapter.call(executors.java:471)     @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334)     @ java.util.concurrent.futuretask.run(futuretask.java:166)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:724) 

what have change in order bean initialized correctly?

cannot convert value of type [groovy.util.configobject] required type [int] property 'tokenlength'

this suggests me don't have grails.plugins.springsecurity.rememberme.persistenttoken.tokenlength property set in grailsapplication.config - when ask configobject non-existent key returns new empty configobject.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -