1 Reply Latest reply on Feb 27, 2018 12:55 PM by Paul Ferraro

    Wildfly10 Cluster jgroup jar not loading - java.lang.NoClassDefFoundError: org/jgroups/protocols/MERGE3$1

    Venkat Susarla Newbie

      Ehcahce dependency is not loading in clustering environment. Same works well in Standalone environment, however with cluster issue is happening randomly. We are using jgroup-3.6.1.0.jar. During the application deployment I'm getting below error.

       

      16:21:04,132 SEVERE [org.jgroups.protocols.UDP] (INT-1,EH_CACHE,LdaptestDC-13382) JGRP000030: LdaptestDC-13382: failed handling incoming message: java.lang.NoClassDefFoundError: org/jgroups/protocols/MERGE3$MergeHeader$Type

      16:21:13,104 SEVERE [org.jgroups.protocols.UDP] (INT-1,EH_CACHE,LdaptestDC-13382) JGRP000030: LdaptestDC-13382: failed handling incoming message: java.lang.NoClassDefFoundError: org/jgroups/protocols/MERGE3$MergeHeader$Type

      16:21:16,448 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382) Exception in thread "Timer-2,EH_CACHE,LdaptestDC-13382" java.lang.NoClassDefFoundError: org/jgroups/protocols/MERGE3$1

       

      16:21:16,448 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.Class.getDeclaringClass0(Native Method)

       

      16:21:16,448 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.Class.getDeclaringClass(Class.java:1235)

       

      16:21:16,448 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.Class.getEnclosingClass(Class.java:1277)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.Class.getSimpleBinaryName(Class.java:1443)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.Class.getSimpleName(Class.java:1309)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jgroups.protocols.MERGE3$InfoSender.toString(MERGE3.java:405)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.String.valueOf(String.java:2994)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.StringBuilder.append(StringBuilder.java:131)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:290)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jgroups.util.TimeScheduler3$RecurringTask.run(TimeScheduler3.java:321)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

       

      16:21:16,449 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at java.lang.Thread.run(Thread.java:745)

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382) Caused by: java.lang.ClassNotFoundException: org.jgroups.protocols.MERGE3$1 from [Module "deployment.RequestCenter.war:main" from Service Module Loader]

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

       

      16:21:16,450 ERROR [stderr] (Timer-2,EH_CACHE,LdaptestDC-13382)     ... 13 more

       

      16:21:19,838 SEVERE [org.jgroups.protocols.UDP] (INT-1,EH_CACHE,LdaptestDC-13382) JGRP000030: LdaptestDC-13382: failed handling incoming message: java.lang.NoClassDefFoundError: org/jgroups/protocols/MERGE3$MergeHeader$Type

       

      Seems I'm missing some configuration here, any suggestions.

       

      Thanks,

      Venkat

        • 1. Re: Wildfly10 Cluster jgroup jar not loading - java.lang.NoClassDefFoundError: org/jgroups/protocols/MERGE3$1
          Paul Ferraro Master

          This looks like a classloading conflict between the JGroups jar in your deployment (used by ehcache) and the server module containing JGroups.  The simplest way to resolve this conflict is to remove the jgroups jar from your deployment and instead import the JGroups module form the server.  To do this, add the line: "Dependencies: org.jgroups" to your deployment's /META-INF/MANIFEST.MF

           

          You must also make sure that messages sent by WF's internal JGroups channel are being received by the JGroups channel used by ehcache (and visa versa).  You must ensure that these clusters are properly isolated by using a distinct bind address/port.