hazeclast merge troube - java.lang.ClassNotFoundException: hz.ADD_NEW_ENTRY

392 views
Skip to first unread message

jpc...@free.fr

unread,
Feb 27, 2014, 8:15:10 AM2/27/14
to haze...@googlegroups.com

Hello,

I work with hazelcast 3.1.5, we are in bench test with a cluster of 3 nodes, one node by server.

sometime we get this problem for unknown reason.  no more information, i investigate on it. if someone have an idea. 
i would save time. thanks.

KR

2014-02-21 14:37:52.966 FATAL [MapService] - [xxxx]:15701 [tms] hz.ADD_NEW_ENTRY

java.lang.ClassNotFoundException: hz.ADD_NEW_ENTRY

        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

        at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:83)

        at com.hazelcast.nio.ClassLoaderUtil.newInstance(ClassLoaderUtil.java:50)

        at com.hazelcast.map.MapService.getMergePolicy(MapService.java:248)

        at com.hazelcast.map.MapService$Merger.run(MapService.java:273)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

        at java.util.concurrent.FutureTask.run(FutureTask.java:262)

        at com.hazelcast.util.executor.ManagedExecutorService$Worker.run(ManagedExecutorService.java:166)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

        at java.lang.Thread.run(Thread.java:744)

        at com.hazelcast.util.executor.PoolExecutorThreadFactory$ManagedThread.run(PoolExecutorThreadFactory.java:59)

2014-02-21 14:37:52.968 FATAL [ClusterService] - [xxxxx]:15701 [tms] While merging...

java.util.concurrent.ExecutionException: com.hazelcast.core.HazelcastException: java.lang.ClassNotFoundException: hz.ADD_NEW_ENTRY

2014-02-21 14:37:52.968 FATAL [ClusterService] - [xxxxx]:15701 [tms] While merging...

java.util.concurrent.ExecutionException: com.hazelcast.core.HazelcastException: java.lang.ClassNotFoundException: hz.ADD_NEW_ENTRY

        at java.util.concurrent.FutureTask.report(FutureTask.java:122)

        at java.util.concurrent.FutureTask.get(FutureTask.java:188)

        at com.hazelcast.cluster.ClusterServiceImpl$6.run(ClusterServiceImpl.java:597)

        at com.hazelcast.instance.LifecycleServiceImpl.runUnderLifecycleLock(LifecycleServiceImpl.java:94)

        at com.hazelcast.cluster.ClusterServiceImpl.merge(ClusterServiceImpl.java:571)

        at com.hazelcast.cluster.MergeClustersOperation.run(MergeClustersOperation.java:53)

        at com.hazelcast.spi.impl.OperationServiceImpl.doRunOperation(OperationServiceImpl.java:274)

        at com.hazelcast.spi.impl.OperationServiceImpl.runOperation(OperationServiceImpl.java:184)

        at com.hazelcast.cluster.AbstractJoiner.startClusterMerge(AbstractJoiner.java:244)

        at com.hazelcast.cluster.TcpIpJoiner.searchForOtherClusters(TcpIpJoiner.java:444)

        at com.hazelcast.cluster.SplitBrainHandler.searchForOtherClusters(SplitBrainHandler.java:46)

        at com.hazelcast.cluster.SplitBrainHandler.run(SplitBrainHandler.java:36)

        at com.hazelcast.util.executor.ManagedExecutorService$Worker.run(ManagedExecutorService.java:166)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

        at java.lang.Thread.run(Thread.java:744)

        at com.hazelcast.util.executor.PoolExecutorThreadFactory$ManagedThread.run(PoolExecutorThreadFactory.java:59)

Caused by: com.hazelcast.core.HazelcastException: java.lang.ClassNotFoundException: hz.ADD_NEW_ENTRY

        at com.hazelcast.util.ExceptionUtil.rethrow(ExceptionUtil.java:45)

        at com.hazelcast.map.MapService.getMergePolicy(MapService.java:252)

        at com.hazelcast.map.MapService$Merger.run(MapService.java:273)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

        at java.util.concurrent.FutureTask.run(FutureTask.java:262)

        ... 5 more

Caused by: java.lang.ClassNotFoundException: hz.ADD_NEW_ENTRY

        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

        at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:83)

        at com.hazelcast.nio.ClassLoaderUtil.newInstance(ClassLoaderUtil.java:50)

        at com.hazelcast.map.MapService.getMergePolicy(MapService.java:248)

       ... 8 more

2014-02-21 14:37:52.969 INFO  [LifecycleService] - [xxxx]:15701 [tms] Address[10.72.70.30]:15701 is MERGED

Noctarius

unread,
Feb 27, 2014, 11:10:37 AM2/27/14
to haze...@googlegroups.com
Can you show your hazelcast configuration? I would say you configured that value as merge policy :)

Chris

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/f0fa72e0-5bf7-4426-bcdb-65a018e7b535%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

jpc...@free.fr

unread,
Feb 27, 2014, 11:22:19 AM2/27/14
to haze...@googlegroups.com, jpc...@free.fr
All map are configured so in our hazelcast.xml, normaly is working, after some investigation,  this problem come always when we lost socket connection/reconnection between node and the reconnection from client.

014-02-27 13:55:16.271 INFO [TcpIpConnection] - [xxxxx]:15701 [tms] Connection [Address[xxxxx]:38271] lost. Reason: Socket explicitly closed
2014-02-27 13:55:16.271 INFO [TcpIpConnection] - [xxxxx.31]:15701 [tms] Connection [Address[xxxxx]:15701] lost. Reason: Socket explicitly closed
2014-02-27 13:55:16.271 INFO [TcpIpConnection] - [xxxxx.31]:15701 [tms] Connection [Address[
xxxxx:15701] lost. Reason: Socket explicitly closed
2014-02-27 13:55:16.271 INFO [TcpIpConnection] - [xxxxx]:15701 [tms] Connection [Address[xxxxx]:38208] lost. Reason: Socket explicitly closed


 <map name="MyMap">
                <backup-count>1</backup-count>
                <time-to-live-seconds>0</time-to-live-seconds>
                <max-idle-seconds>0</max-idle-seconds>
                <eviction-policy>LRU</eviction-policy>
                <max-size policy="PER_NODE">10000</max-size>
                <merge-policy>hz.ADD_NEW_ENTRY</merge-policy>
                <statistic-enabled>true</statistic-enabled>
                <map-store enabled="true">
                        <class-name>myMapStore</class-name>
                        <write-delay-seconds>10</write-delay-seconds>
                </map-store>
        </map>

Noctarius

unread,
Feb 27, 2014, 11:29:02 AM2/27/14
to haze...@googlegroups.com, jpc...@free.fr
Yeah because this class is tried to be loaded on remerging of a cluster. That’s the merge policy:
<merge-policy>hz.ADD_NEW_ENTRY</merge-policy>

And there you find your weird classname but it doesn’t seem to be your fault. It looks to me like the documentation is a bit outdated / wrong because this was the old value. With 3.x we moved to canonical classnames for the definition.

Just change “hz.ADD_NEW_ENTRY” to “com.hazelcast.map.merge.PutIfAbsentMapMergePolicy” and you should be good to go.

Chris

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.

jpc...@free.fr

unread,
Feb 27, 2014, 11:32:02 AM2/27/14
to haze...@googlegroups.com, jpc...@free.fr
ok, i understand

   hazelcast.xml seem not up to date 
 
            com.hazelcast.map.merge.PassThroughMergePolicy; entry will be added if there is no existing entry for the key.
            com.hazelcast.map.merge.PutIfAbsentMapMergePolicy ; entry will be added if the merging entry doesn't exist in the cluster.
            com.hazelcast.map.merge.HigherHitsMapMergePolicy ; entry with the higher hits wins.
            com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins. 

i look like to be replace  hz.ADD_NEW_ENTRY by PassThroughMergePolicy

Thanks 
KR

jpc...@free.fr

unread,
Feb 27, 2014, 11:35:47 AM2/27/14
to haze...@googlegroups.com, jpc...@free.fr, noctar...@googlemail.com

Thanks Noctarius

KR

Noctarius

unread,
Feb 27, 2014, 11:38:52 AM2/27/14
to jpc...@free.fr, haze...@googlegroups.com
Sorry for the inconvenience, we’ll update the documentation, thanks for pointing on it (even if it was just indirectly ;-)).

Chris

Am 27.02.2014 um 17:35 schrieb jpc...@free.fr:

>
> Thanks Noctarius
>
> KR
>

Reply all
Reply to author
Forward
0 new messages