I use shiro in my web site. My web is SpringMVC+SPring+mybaits.
shiro works well. I don't use cache and there are lots of connection between
web and db. In server console windwo, I find lots of information such as
"2013-10-15 13:43:14,585 INFO [org.apache.shiro.realm.AuthorizingRealm] -
<No cache or cacheManager properties have been 
set.  Authorization cache cannot be obtained.>".

Then I decide to use cache now. In ApplicationContext.xml, I add followed
sentence:
<bean id="cacheManager"
class="org.apache.shiro.cache.ehcache.EhCacheManager" scope="singleton" /

Then the web counldn't be deployed well. It shows error:
BeanPostProcessor before instantiat
ion of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
wit
h name
'org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0'
defined in file [E:\develops
oft\Tomcat6\webapps\wscloud\WEB-INF\classes\spring\applicationContext.xml]:
Cannot resolve reference to bean 'securityMa
nager' while setting bean property 'securityManager'; nested exception is
org.springframework.beans.factory.BeanCreation
Exception: Error creating bean with name 'securityManager' defined in file
[E:\developsoft\Tomcat6\webapps\wscloud\WEB-I
NF\classes\spring\applicationContext.xml]: Initialization of bean failed;
nested exception is org.springframework.beans.
factory.BeanCreationException: Error creating bean with name 'cacheManager'
defined in file [E:\developsoft\Tomcat6\weba
pps\wscloud\WEB-INF\classes\spring\applicationContext.xml]: Initialization
of bean failed; nested exception is org.sprin
gframework.beans.ConversionNotSupportedException: Failed to convert property
value of type 'org.apache.shiro.cache.ehcac
he.EhCacheManager' to required type 'net.sf.ehcache.CacheManager' for
property 'cacheManager'; nested exception is java.
lang.IllegalStateException: Cannot convert value of type
[org.apache.shiro.cache.ehcache.EhCacheManager] to required typ
e [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching
editors or conversion strategy found. 

What is wrong ?  I use shiro-all-1.2.2.jar and ehcache-core-2.6.6.jar.





--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/CacheManager-convert-error-tp7579236.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to