I've got some problems with integrating EhCacheManagerFactory with my Spring
application.
As I noticed there is no possibility to use a plain shiro.ini configuration
file with Spring Framework.
We can only define [Users] and [Roles] sections in ini file and connect it
in xml configuration in this way:
*/
<bean name="iniRealm" class="org.apache.shiro.realm.text.IniRealm">
<constructor-arg type="java.lang.String" value="classpath:shiro.ini"/>
</bean>/*
Please let me know if I am wrong.
I was trying to reconstruct my shiro.ini's [Main] section which is:
*
/ehCacheManager = my.package.shiro.EhCacheManagerFactory
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManager = $ehCacheManager
securityManager.cacheManager = $cacheManager/*
to xml form and I've got:
*
/<bean id="ehCacheManager" class="my.package.shiro.EhCacheManagerFactory"/>
<bean id="cacheManager"
class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="ehCacheManager"/>
</bean>
<bean id="securityManager"
class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="cacheManager" ref="cacheManager"/>
</bean>/*
Unfortunately I have such error during deployment:
/org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'shiroFilter' defined in ServletContext resource
[/WEB-INF/spring/root-context.xml]: BeanPostProcessor before instantiation
of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name
'org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0'
defined in ServletContext resource [/WEB-INF/spring/root-context.xml]:
Cannot resolve reference to bean 'securityManager' while setting bean
property 'securityManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'securityManager' defined in ServletContext resource
[/WEB-INF/spring/root-context.xml]: Cannot resolve reference to bean
'cacheManager' while setting bean property 'cacheManager'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'cacheManager' defined in ServletContext resource
[/WEB-INF/spring/root-context.xml]: Initialization of bean failed; nested
exception is org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type
'my.package.shiro.shiro.EhCacheManagerFactory' to required type
'net.sf.ehcache.CacheManager' for property 'cacheManager'; nested exception
is java.lang.IllegalStateException: *Cannot convert value of type
[my.package.shiro.shiro.EhCacheManagerFactory] to required type
[net.sf.ehcache.CacheManager] for property 'cacheManager': no matching
editors or conversion strategy found/*
Does anyone knows what should I do now?
-----
-----------------------
Paweł Piątkowski
http://pl.linkedin.com/in/ppiatkowski
--
View this message in context:
http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577596.html
Sent from the Shiro User mailing list archive at Nabble.com.