Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.springframework.cache.ehcache was removed from spring-context-support in 6.0.x. What is an alternative to the package? #30641

Closed
Kaivalya31 opened this issue Jun 12, 2023 · 2 comments
Labels
for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid

Comments

@Kaivalya31
Copy link

Kaivalya31 commented Jun 12, 2023

I am using the ehcache package from the spring-context-support JAR in my code. In the 6.0.x version, then entire package has been removed(refer to SS below). spring-context-support 6.0.x git repo I am looking for an alternative to this package or if it's been moved elsewhere.

I've tried searching for its alternative or if it has been moved to some other package as this has been done before as well. I tried searching the list of deprecated classes in 6.0.x, but classes of this package aren't mentioned there so I couldn't find a solution there as well.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 12, 2023
@bclozel bclozel changed the title The 'ehcahce' package(org.springframework.cache.ehcache) is removed from spring-context-support 6.0.x version. What is an alternative to the package? org.springframework.cache.ehcache was removed from spring-context-support in 6.0.x. What is an alternative to the package? Jun 12, 2023
@bclozel
Copy link
Member

bclozel commented Jun 12, 2023

This ehcache package was removed in d84ca2b as part of our baseline upgrade for Spring Framework 6.0. net.sf.ehcache is relying on JavaEE APIs (javax.*) and we had to remove this support when moving to Jakarta EE APIs.

Additionally, ehcache 2.x is almost EOL and ehcache3 is the direct replacement. You should revisit your dependency management to use org.ehcache:ehcache (with the jakarta classifier) instead and look into the official migration guide or reach out to the ehcache community for assistance. We did not replace org.springframework.cache.ehcache with an updated version, as using ehcache through the JCache API or its new native API is preferred.

I'll add a note about this in our upgrade section.

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
@bclozel bclozel added status: invalid An issue that we don't feel is valid for: stackoverflow A question that's better suited to stackoverflow.com and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 12, 2023
@ben-manes
Copy link
Contributor

ben-manes commented Feb 6, 2025

ehcache3 is the direct replacement

I am unsure if that is actually true. According to one of the authors of Ehcache 3.x it was not designed to be used in cases where the cache would evict due to capacity, e.g. typical application caches with small resource limits. That was my use-case for using ehcache 1.x back in those days, and I think many users would likewise expect use an LRU cache for that purposes. If it was not designed for the same use-cases as the previous versions, then this could cause surprises during migration. I am more confused by this and past statements, and unsure if we have different concepts of what a cache and LRU mean, but regardless that is their design intent and why they have not resolved a denial of service exploitation because they view it as misuse by end users. If I am confused then I suspect others would be too.

Ehcache, at least by default, will indeed by unhappy if the cache is full and you keep adding to it, thus causing evictions to occur. […] The cache works super well but should never be full.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants