• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • ehcache-core
  • alexsnaps
  • Reporter: markwoon
  • November 21, 2011
  • 0
  • Watchers: 2
  • July 27, 2012
  • December 05, 2011

Description

The net.sf.ehcache.configurationResourceName property is ignored in 2.5.0.

Configuration works just fine with previous versions. Suddenly switches to using default ehcache.xml in 2.5.0.

Comments

Chris Dennis 2011-11-28

Without knowing more about the exact environment here I can’t be sure but I’m wondering if this might be related to the new requirement to name cache managers in 2.5.0. If the config at the location specified by the {{net.sf.ehcache.configurationResourceName}} property doesn’t define a name, and a cache manager has already been created from the default {{ehcache.xml}} in the same application then he’ll get that manager since they will both have the default name.

Mark Woon 2011-11-28

I’m using this with Hibernate 3.3 and I don’t see anything in the docs (http://www.ehcache.org/documentation/integrations/hibernate) about this.

What kind of environmental info do you need?

Chris Dennis 2011-11-30

Could you try this as a quick solution (if you haven’t already)…

Find the ehcache.xml file that you are referencing with your {{net.sf.ehcache.configurationResourceName}} property and add a {{name=”foo”}} attribute to the {{\}\} element (you might want to pick a more logical name). If my hunch is right then this should solve your problem.

Your ehcache.xml will then look something like this:

<ehcache name="hibernate-caching">
  <defaultCache maxElementsInMemory="0" eternal="true">
  </defaultCache>
</ehcache>

Mark Woon 2011-12-01

That did the trick!

Alexander Snaps 2011-12-05

Reverted r4896. See comment on DEV-6423