• 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.(ILjava/io/Serializable;Lnet/sf/ehcache/Element;)V at net.sf.ehcache.distribution.jgroups.JGroupEventMessage.(JGroupEventMessage.java:86) at net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.replicatePutNotification(JGroupsCacheReplicator.java:203) at net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.notifyElementPut(JGroupsCacheReplicator.java:144) at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementPut(RegisteredEventListeners.java:192) at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:170) at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1631) at net.sf.ehcache.Cache.putInternal(Cache.java:1601) at net.sf.ehcache.Cache.put(Cache.java:1526) at net.sf.ehcache.Cache.put(Cache.java:1491)

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

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

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();