EHC ❯ Incompatible constructors between JGroupEventMessage and net.sf.ehcache.distribution.EventMessage
-
Bug
-
Status: New
-
2 Major
-
Resolution:
-
ehcache-jgroupsreplication
-
-
drb
-
Reporter: kikosha
-
December 16, 2014
-
0
-
Watchers: 1
-
December 17, 2014
-
Description
These are the relevant parts of my ehcache.xml:
The synchronization crashes with this:
Exception in thread “main” java.lang.NoSuchMethodError: net.sf.ehcache.distribution.EventMessage.
I checked the source code of these classes, net.sf.ehcache.distribution.jgroups.JGroupEventMessage constructor calls the net.sf.ehcache.distribution.EventMessage constructor:
public JGroupEventMessage(int event, Serializable key, Element element, String cacheName) {
super(event, key, element);
this.cacheName = cacheName;
this.asyncTime = -1;
}
which is:
public EventMessage(Ehcache cache, Serializable key) {
this.cache = cache;
this.key = key;
}
apparently, this can’t work. Just to be sure, I extracted the class files and decompiled them, and that is the code.
Comments
Ilya Kikoin 2014-12-16
Ilya Kikoin 2014-12-17
The only change that needs to be done in jgroupsreplication1.7 is in JGroupsCacheManagerPeerProviderFactory.java, line 61: final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
After looking through the code, I realized that jgroupsreplication1.7 seem compatible with ehcache-core2.9.0, since there the JGroupEventMessage inherits the LegaceEventMessage which looks like a copy from 2.5.0. But I didn’t find any build artifact for that version