Acegi配置user缓存出错

  今天在给Acegi配置user缓存的时候,报了这样一个错误。具体如下:

Error creating bean with name 'authenticationProcessingFilter' defined in file [D:\apache-tomcat-6.0.16\webapps\AcegiTest\WEB-INF\classes\spring\applicationContext-acegi-security.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in file [D:\apache-tomcat-6.0.16\webapps\AcegiTest\WEB-INF\classes\spring\applicationContext-acegi-security.xml]: Cannot resolve reference to bean 'daoAuthenticationProvider' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoAuthenticationProvider' defined in file [D:\apache-tomcat-6.0.16\webapps\AcegiTest\WEB-INF\classes\spring\applicationContext-acegi-security.xml]: Cannot resolve reference to bean 'userCache' while setting bean property 'userCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCache' defined in file [D:\apache-tomcat-6.0.16\webapps\AcegiTest\WEB-INF\classes\spring\applicationContext-acegi-security.xml]: Cannot resolve reference to bean 'userCacheBackend' while setting bean property 'cache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCacheBackend' defined in file [D:\apache-tomcat-6.0.16\webapps\AcegiTest\WEB-INF\classes\spring\applicationContext-acegi-security.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: net.sf.ehcache.Cache.<init>(Ljava/lang/String;ILnet/sf/ehcache/store/MemoryStoreEvictionPolicy;ZLjava/lang/String;ZJJZJLnet/sf/ehcache/event/RegisteredEventListeners;Lnet/sf/ehcache/bootstrap/BootstrapCacheLoader;I)V

  
  说的是我用的ehcache没有net.sf.ehcache.Cache.<init>这个方法,我的ehcache版本是1.2.3。 http://forum.springsource.org/showthread.php?t=49956。找了下原因,可能是版本问题。我从acegi-security-samples-contacts-1.0.6.war里面拷贝了个ehcache-1.2.4.jar后,重新部署启动,正常了。

你可能感兴趣的:(spring,tomcat,bean,Security,Acegi)