You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by PPiatkowski <pi...@gmail.com> on 2012/06/28 15:12:50 UTC

Re: Shiro and multiple wars within the same Servlet Container

Hi,

I've got some problem with sharing Ehcache between two applications within
one Tomcat instance.
I've tried f a v's solution but unfortunatelly it doesn't work for me and I
am wondering if something changed from the last 2 years.

This is what I am using now:
1. Apache Shiro 1.2.0
2. Ehcache 2.5.2
3. Apache Tomcat 6.0.35

I've put ehcache-core-2.5.2.jar in Tomcat's lib folder and
shiro-ehcache-1.2.0.jar in the projects' classpath.

After running the second application f a v's solution gives me such error:

org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException:
Another unnamed CacheManager already exists in the same VM. Please provide
unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same
CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.

Any ideas?

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577555.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Les Hazlewood <lh...@apache.org>.
Glad to help! :)

--
Les Hazlewood | @lhazlewood
CTO, Stormpath | http://stormpath.com | @goStormpath | 888.391.5282
Stormpath wins GigaOM Structure Launchpad Award! http://bit.ly/MvZkMk


On Fri, Jul 13, 2012 at 12:45 AM, Paweł Piątkowski
<pi...@gmail.com> wrote:
> Thank you Les!
>
> /<bean id="ehCacheManager"
> class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
>     <property name="shared" value="true"/>
> </bean>/
>
> works like a charm :)
>
> -----
> -----------------------
> 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-tp5560737p7577600.html
> Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Paweł Piątkowski <pi...@gmail.com>.
Thank you Les!

/<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="shared" value="true"/>
</bean>/

works like a charm :)

-----
-----------------------
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-tp5560737p7577600.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Les Hazlewood <lh...@apache.org>.
The Shiro Factory interface will resolve to its constructed instance
in Shiro's .ini configuration automatically.

It will not do that in Spring configuration however (Spring has no
knowledge of Shiro's Factory concept and therefore doesn't know how to
automatically resolve the Factory's created instance).

Instead, Spring can support what you want by implementing Spring's
FactoryBean interface.

If your my.package.shiro.EhCacheManagerFactory implementation
implemented FactoryBean (or even better, subclassed
AbstractFactoryBean), I think you will have what you want, but note:

If you're going to do all this in Spring, maybe you should be using
Spring's out-of-the-box EhCacheManagerFactoryBean which already
provides an EhCacheManager in a Spring environment.  I don't know if
it will meet your needs, but it is probably worth checking it out
before you develop your own.

HTH,

--
Les Hazlewood | @lhazlewood
CTO, Stormpath | http://stormpath.com | @goStormpath | 888.391.5282
Stormpath wins GigaOM Structure Launchpad Award! http://bit.ly/MvZkMk


On Thu, Jul 12, 2012 at 7:09 AM, Paweł Piątkowski
<pi...@gmail.com> wrote:
> 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.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Paweł Piątkowski <pi...@gmail.com>.
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.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Pawel_Piatkowski <pi...@gmail.com>.
It was it! Thanks a lot Jared!

I've thought ehcache-core-2.5.2.jar on the server libs is sufficient.

I think that it should be described somewhere in the documentation in the
future.
Running multiple applications with the same cache on one server is very
popular case I think.

-----
-----------------------
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-tp5560737p7577574.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Jared Bunting <ja...@peachjean.com>.
Looks like a classloader issue.  My guess is that you have the shiro 
jars in the war files, rather than at the same level as the ehcache 
jar?  In order for this to work, both applications would need to load 
the shiro classes from the same classloader.  This probably means 
putting the shiro jars at the server level, the same way as you have 
done ehcache.  (org.apache.shiro.session.Session loading in application 
A != org.apache.shiro.session.Session loaded in application B)

Hope that helps,
Jared

On Fri 06 Jul 2012 07:36:03 AM CDT, Pawel_Piatkowski wrote:
> Hi Jared,
>
> Thank you for your advice.
> I've tried something like this:
>
> /public class EhCacheManagerFactory implements Factory<CacheManager> {
>
> 	public CacheManager getInstance() {
> 		return CacheManager.create();
> 	}
> }/
>
> which should work similar to your solution but when I try to get session
> with conrete id [*sessionIdFromParam*]:
>
> /Subject currentUser = new
> Subject.Builder().sessionId(*sessionIdFromParam*).buildSubject();/
>
> passed by GET parameter I get the following exception:
>
> /java.lang.ClassCastException: org.apache.shiro.session.mgt.SimpleSession
> cannot be cast to org.apache.shiro.session.Session
>
> org.apache.shiro.session.mgt.eis.CachingSessionDAO.getCachedSession(CachingSessionDAO.java:217)
>
> org.apache.shiro.session.mgt.eis.CachingSessionDAO.getCachedSession(CachingSessionDAO.java:202)
>
> org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:259)
>
> org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236)
>
> org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222)
>
> org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118)
>
> org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:105)
>
> org.apache.shiro.session.mgt.AbstractNativeSessionManager.getSession(AbstractNativeSessionManager.java:97)
>
> org.apache.shiro.mgt.SessionsSecurityManager.getSession(SessionsSecurityManager.java:125)
>
> org.apache.shiro.mgt.DefaultSecurityManager.resolveContextSession(DefaultSecurityManager.java:456)
>
> org.apache.shiro.mgt.DefaultSecurityManager.resolveSession(DefaultSecurityManager.java:442)
>
> org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:338)
> 	org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846)
> 	pl.compugroup.servlet.SessionServlet.doGet(SessionServlet.java:57)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
>
> org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
>
> org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
>
> org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
>
> org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
>
> org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
>
> org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)/
>
> It happens only when I try to retrieve session created in application A from
> application B so it looks that something works here.
>
> I've got such shiro.ini configuration:
>
> /ehCacheManager = pl.compugroup.shiro.EhCacheManagerFactory
> cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> cacheManager.cacheManager = $ehCacheManager
> cacheManager.cacheManagerConfigFile = classpath:ehcache.xml
> securityManager.cacheManager = $cacheManager
>
> sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
>
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
> sessionManager.sessionDAO = $sessionDAO
> securityManager.sessionManager = $sessionManager/
>
> -----
> -----------------------
> 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-tp5560737p7577572.html
> Sent from the Shiro User mailing list archive at Nabble.com.



Re: Shiro and multiple wars within the same Servlet Container

Posted by Pawel_Piatkowski <pi...@gmail.com>.
Hi Jared,

Thank you for your advice.
I've tried something like this:

/public class EhCacheManagerFactory implements Factory<CacheManager> {

	public CacheManager getInstance() {
		return CacheManager.create();
	}
}/

which should work similar to your solution but when I try to get session
with conrete id [*sessionIdFromParam*]:

/Subject currentUser = new
Subject.Builder().sessionId(*sessionIdFromParam*).buildSubject();/

passed by GET parameter I get the following exception:

/java.lang.ClassCastException: org.apache.shiro.session.mgt.SimpleSession
cannot be cast to org.apache.shiro.session.Session

org.apache.shiro.session.mgt.eis.CachingSessionDAO.getCachedSession(CachingSessionDAO.java:217)

org.apache.shiro.session.mgt.eis.CachingSessionDAO.getCachedSession(CachingSessionDAO.java:202)

org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:259)

org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236)

org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222)

org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118)

org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:105)

org.apache.shiro.session.mgt.AbstractNativeSessionManager.getSession(AbstractNativeSessionManager.java:97)

org.apache.shiro.mgt.SessionsSecurityManager.getSession(SessionsSecurityManager.java:125)

org.apache.shiro.mgt.DefaultSecurityManager.resolveContextSession(DefaultSecurityManager.java:456)

org.apache.shiro.mgt.DefaultSecurityManager.resolveSession(DefaultSecurityManager.java:442)

org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:338)
	org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846)
	pl.compugroup.servlet.SessionServlet.doGet(SessionServlet.java:57)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)

org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)/

It happens only when I try to retrieve session created in application A from
application B so it looks that something works here.

I've got such shiro.ini configuration:

/ehCacheManager = pl.compugroup.shiro.EhCacheManagerFactory 
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManager = $ehCacheManager 
cacheManager.cacheManagerConfigFile = classpath:ehcache.xml
securityManager.cacheManager = $cacheManager

sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager

sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
sessionManager.sessionDAO = $sessionDAO
securityManager.sessionManager = $sessionManager/

-----
-----------------------
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-tp5560737p7577572.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by PPiatkowski <pi...@gmail.com>.
Thank you Jared.

My final and working solution is even simpler:

public class EhCacheManagerFactory implements Factory<CacheManager> {

	public CacheManager getInstance() {
		return CacheManager.create();
	}
}

It creates a new instance of EhCacheManager when it doesn't exist and
returns the new one when it was created before.

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577571.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Jared Bunting <ja...@peachjean.com>.
Bear in mind that I haven't done this myself.  But the issue resolves 
around the fact that EhCache only allows one CacheManager per name 
statically, and Shiro doesn't use EhCache's "create or retrieve" 
method.  I personally don't care for the EhCache pattern here - in my 
mind passing in a config file and potentially getting back a 
CacheManager that is completely unrelated except that it shares the 
same name is a fair bit counterintuitive to me.  Seems to open up the 
doors to confusing and misleading problems down the road.

However, if you want to share a single CacheManager between multiple 
webapps you need to instructor Shiro to use EhCache's create or 
retrieve method.

The factory should look something like this:

package com.example.shiro;

import net.sf.ehcache.CacheManager;
import org.apache.shiro.util.Factory;

public class SharedEhCacheManagerFactory implements 
Factory<CacheManager>
{
	private String configFile;

	@Override
	public CacheManager getInstance()
	{
		return CacheManager.newInstance(this.configFile);
	}

	public String getConfigFile()
	{
		return configFile;
	}

	public void setConfigFile(final String configFile)
	{
		this.configFile = configFile;
	}
}


And then your shiro.ini would look something like this:

ehCacheManager = com.example.shiro.SharedEhCacheManagerFactory
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManager=$ehCacheManager


Hope that helps,
Jared

On Fri 29 Jun 2012 07:17:18 AM CDT, PPiatkowski wrote:
> Jared, could you please give me a little hint how to achieve this "one line
> method"?
>
> You've told that factory class should implement
> org.apache.shiro.util.Factory interface. It gives us T 	getInstance() method
> to implement in our class.
>
> I think that getInstance() method should return EhCacheManager object but
> how can I create instance or return from some context for example by given
> Ehcache name?
>
> Pawel
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577562.html
> Sent from the Shiro User mailing list archive at Nabble.com.



Re: Shiro and multiple wars within the same Servlet Container

Posted by PPiatkowski <pi...@gmail.com>.
Jared, could you please give me a little hint how to achieve this "one line
method"?

You've told that factory class should implement
org.apache.shiro.util.Factory interface. It gives us T 	getInstance() method
to implement in our class.

I think that getInstance() method should return EhCacheManager object but
how can I create instance or return from some context for example by given
Ehcache name?

Pawel

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577562.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by Jared Bunting <ja...@peachjean.com>.
If you want to share the CacheManager across webapps, then yes, you will
need a custom factory.  Fortunately this would only be like a one line
method.

-Jared
On Jun 29, 2012 2:29 AM, "PPiatkowski" <pi...@gmail.com> wrote:

> Thank you Jérôme. I appreciate your help but I've seen this topic before.
> Jared Bunting-2 is suggesting that the only way to use one shared ehache
> instance for multiple applications in the same VM is to implement some
> custom CacheManagerFactory.
>
> Is this the only way to solve my problem?
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577558.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Shiro and multiple wars within the same Servlet Container

Posted by PPiatkowski <pi...@gmail.com>.
Thank you Jérôme. I appreciate your help but I've seen this topic before.
Jared Bunting-2 is suggesting that the only way to use one shared ehache
instance for multiple applications in the same VM is to implement some
custom CacheManagerFactory.

Is this the only way to solve my problem?

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577558.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro and multiple wars within the same Servlet Container

Posted by jleleu <le...@gmail.com>.
Hi,

I remember another thread on this EhCache problem :
http://shiro-user.582556.n2.nabble.com/EhCache-initialization-exception-Another-unnamed-CacheManager-already-exists-in-the-same-VM-td7577532.html.
Take a look at it.
Best regards,
Jérôme


--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-and-multiple-wars-within-the-same-Servlet-Container-tp5560737p7577557.html
Sent from the Shiro User mailing list archive at Nabble.com.