java.lang.NoSuchMethodError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • These are the relevant parts of my ehcache.xml: <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties="channel=ehcache^connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32; mcast_send_buf_size=150000;mcast_recv_buf_size=80000): PING(timeout=2000;num_initial_members=6): MERGE2(min_interval=5000;max_interval=10000): FD_SOCK:VERIFY_SUSPECT(timeout=1500): pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000): UNICAST(timeout=5000): pbcast.STABLE(desired_avg_gossip=20000): FRAG: pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)" propertySeparator="^" /> <cache name="sampleRepicatedCache2" maxEntriesLocalHeap="10" eternal="false" timeToIdleSeconds="100" timeToLiveSeconds="100"> <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true,asynchronousReplicationIntervalMillis=1000"/> </cache> The synchronization crashes with this: Exception in thread "main" java.lang.NoSuchMethodError: net.sf.ehcache.distribution.EventMessage.<init>(ILjava/io/Serializable;Lnet/sf/ehcache/Element;)V at net.sf.ehcache.distribution.jgroups.JGroupEventMessage.<init>(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.
    via by Ilya Kikoin,
  • These are the relevant parts of my ehcache.xml: <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory" properties="channel=ehcache^connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32; mcast_send_buf_size=150000;mcast_recv_buf_size=80000): PING(timeout=2000;num_initial_members=6): MERGE2(min_interval=5000;max_interval=10000): FD_SOCK:VERIFY_SUSPECT(timeout=1500): pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000): UNICAST(timeout=5000): pbcast.STABLE(desired_avg_gossip=20000): FRAG: pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)" propertySeparator="^" /> <cache name="sampleRepicatedCache2" maxEntriesLocalHeap="10" eternal="false" timeToIdleSeconds="100" timeToLiveSeconds="100"> <cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true,asynchronousReplicationIntervalMillis=1000"/> </cache> The synchronization crashes with this: Exception in thread "main" java.lang.NoSuchMethodError: net.sf.ehcache.distribution.EventMessage.<init>(ILjava/io/Serializable;Lnet/sf/ehcache/Element;)V at net.sf.ehcache.distribution.jgroups.JGroupEventMessage.<init>(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.
    via by Ilya Kikoin,
    • java.lang.NoSuchMethodError: net.sf.ehcache.distribution.EventMessage.<init>(ILjava/io/Serializable;Lnet/sf/ehcache/Element;)V at net.sf.ehcache.distribution.jgroups.JGroupEventMessage.<init>(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)
    No Bugmate found.