| Author |
Message |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 10/26/2009 05:19:02
|
aladijan
neo
Joined: 10/26/2009 05:09:51
Messages: 3
Offline
|
Hi,
we are using ehcache 1.5.0 in a java j2ee web application. I would need to rename the configuration file ehcache.xml to something else (e.g. like MyApp_ehcache.xml). I wonder if this is possible somehow through a property value or something ? The problem has arised in Oracle WebLogic 10.3, when we have two different applications in the same configuration domain. I would need to direct both applications to their own ehcache.xml files, but unfortunately in WLS 10.3 there is a problem related to this. Setting the ehcache configuration filename would overcome this problem.
I'm using the SimplePageCachingFilter without Hibernate.
I appreciate , if someone can assist me with this isuue !
Jan-Erik
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 10/26/2009 12:58:20
|
teck
seraphim
Joined: 05/24/2006 15:03:25
Messages: 1099
Offline
|
I didn't go back to ehcache 1.5.0, but looking at the latest source for SimplePageCachingFilter, it looks like you'd need to subclass it and override getCacheManager() to get a differently named config resource loaded.
You seem to be making reference to some wierdness in weblogic that is making this hard/impossible, but I would have thought that since these are difference apps/WARs that you could have the same resource (ehcache.xml) in each but with differing content.
It seems like maybe there is a request for an enhancement here which would be to take a servlet init param with the name of the resource to load when creating the cache manager. That would maybe help you avoid a subclass here.
|
Tim Eck (terracotta engineer)
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 10/26/2009 14:38:23
|
gluck
qaestor
Joined: 09/15/2009 18:01:23
Messages: 179
Location: Brisbane, Australia
Offline
|
1. Create a ServletContextListener.
2. In the contextInitialized method call CacheManager.create(... As a parameter you can specify a filename for ehcache.xml, or an InputStream or an URL.
Now because you have created the singleton already, the filter will simply call CacheManager.getInstance() and return back the singleton you already create.
No need to subclass and all done in a few lines of code.
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 10/26/2009 23:17:03
|
aladijan
neo
Joined: 10/26/2009 05:09:51
Messages: 3
Offline
|
Hi,
Thank's for your help!
I'll try to implement CacheManager.create method call and see if this will help.
I'll let you known, if I get it to work.
BR Jan-Erik
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 10/27/2009 00:57:49
|
aladijan
neo
Joined: 10/26/2009 05:09:51
Messages: 3
Offline
|
Hi,
the Create method from the servlet contextInitialized seems to work.
thank's for your quick help !
BR Jan-Erik
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 07/18/2011 02:17:52
|
rajoshi
seraphim
Joined: 07/04/2011 04:36:10
Messages: 1465
Offline
|
The issue seems to be resolved.Please let know in case of more information.
|
Rakesh Joshi
Terracotta. |
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 02/02/2012 01:38:10
|
tuno
neo
Joined: 02/02/2012 01:31:29
Messages: 1
Offline
|
Hi Jan-Erik,
I am looking for a similar solution where you can configure the SimplePageCachingFilter to load it's configuration outside the application classpath. For example a configuration directory. Maybe it's an idea to commit your solution back to the ehcache-web project so people could extend this features.
Kind Regards,
Tuno
aladijan wrote:
Hi,
the Create method from the servlet contextInitialized seems to work.
thank's for your quick help !
BR Jan-Erik
|
|
|
 |
|
|