Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Jcache in a EE project ignores ehcache.xml

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am coming from the Spring World and now i am working in a pure EE project. I need to implement cache for a couple of simple methods.I will show you my implementation that it s FULLY working now:

CacheProducer:(Create the cache Bean when the application startup)


The Method i want to catch :

The other thing is,if i want to avoid all that code i thought i could put that configuration inside ehcache.xml.So before adding that code i added the following lines inside ehcache.xml (Version 3.5):

But that is completely ignored.I even have this message in the console when Java reach the method i want to permorm cache:

WARNING [org.jsr107.ri.annotations.DefaultCacheResolverFactory] (default task-1) No Cache named '' was found in the CacheManager, a default cache will be created.

Then to summarize,my questions are:

1-Is the first programmatic implementation Ok?Or there is a better one?
2-What am i missing if i want to implement the Ehcache.xml configuration?

Thanks in advance.
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic