is there a way to run ehcache 2 AND ehcache 3 SIDE-BY-SIDE

200 views
Skip to first unread message

Noel Diaz

unread,
Jul 22, 2016, 4:26:28 PM7/22/16
to ehcache-users
version of Ehcache currently using: 3.1 AND 2.10
JDK 8 and OS  Debian.

We are merging different applications written by different people ... We will eventually re-write to the latest but just in case:
Is it possible to run the two versions without class-collisions ? (shading ?, etc)

Alex Snaps

unread,
Jul 22, 2016, 4:40:22 PM7/22/16
to ehcache-users
Thinking quickly about it, I'd be tempted to say yes... 2 & 3 use different namespaces, package names.
2.x had no offheap, cause I think that would have had some overlap (other than you want to use a 2.x EE release, i.e. not open source).
Clustering both code bases could be an issue too, but I let someone who's been involved with that chime in... 


--
You received this message because you are subscribed to the Google Groups "ehcache-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.
To post to this group, send email to ehcach...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/55d5d5e9-bb2a-4293-a7b8-7e717284e9a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Alex Snaps
Twitter: @alexsnaps

Noel Diaz

unread,
Jul 22, 2016, 5:15:11 PM7/22/16
to ehcache-users
Well as of now I see collisions in:

org/terracotta/context/*

AND 

org/terracotta/statistics/*

I am not sure if it is possible  isolate those :(

Alex Snaps

unread,
Jul 22, 2016, 5:19:27 PM7/22/16
to ehcache-users
Ah! Crap. The stats indeed. Maybe these are an issue though. Chris? You know maybe. Dunno if these needed an incompatible release...

For more options, visit https://groups.google.com/d/optout.

Chris Dennis

unread,
Jul 22, 2016, 5:47:17 PM7/22/16
to ehcach...@googlegroups.com
They do collide… although I believe this has been tested briefly in-house and the collisions worked out ‘okay’. One thing that might make this safer would be to use an unshaded copy of Ehcache 2.x so that you can force 2.x to use the newer copy of the statistics library (which is where those packages come from). Assuming you’re only using basic unclustered ehcache that would mean depending directly on net.sf.ehcache.internal:ehcache-core:2.10.x, and then making sure you don’t pull the transitive dependency on org.terracotta.internal:statistics:1.0.2 and instead use the dependency from Ehcache 3.x (org.terracotta:statistics:1.1.0). I’ve done some quick shakedown testing of an equivalent to this locally and things seem to be okay. This is something that we’re interested in supporting so if you run in to further issues please get back in touch!

Thanks,

Chris
> To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/d17f17d5-b7dd-4413-8e8a-216519e46e0b%40googlegroups.com.

Noel Diaz

unread,
Jul 26, 2016, 5:04:26 PM7/26/16
to ehcache-users
Just Reporting back ... If I do as Chris suggested it all seems 'OK'!!!
I somehow would appreciate if you guys can either shade these libraries at release time 
OR supply a common separated JAR that can be used by both.
If that becomes official I wouldn't have to play tricks to make it all work. 
Thanks for all the fish...

Ben Middleton

unread,
Oct 3, 2016, 9:46:05 AM10/3/16
to ehcache-users
We also have customers who use ehcache 2 in their web applications - so the ability to run it alongside 3.1 would be a valuable feature.

Ben Middleton

unread,
Oct 6, 2016, 9:56:58 AM10/6/16
to ehcache-users
We have another issue as well. If the ehCache 3 implementation does not specify a cache URI, it will fallback to ehcache-failsafe.xml. In a mixed v2 and v3 setup, the v2 ehcache-failsafe.xml is loaded, and throws an exception. It would be nice if the ehCache 3 failsafe configuration had a different name to allow both to coexist.

Louis Jacomet

unread,
Oct 6, 2016, 10:00:18 AM10/6/16
to ehcache-users
Hi Ben,

That makes no sense. Ehcache 3 does not have any default.

Can you describe a bit more what you are seeing?

Regards,
Louis

Reply all
Reply to author
Forward
0 new messages