0 Replies Latest reply on Oct 9, 2012 3:09 PM by dinesh_hyd

    java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ReadWriteLock

    dinesh_hyd

      I am in the process of migrating a web application from jboss-4.0.4.GA to JBoss 7.

       

      This is a an application with single .war file

       

      The following is the error getting displayed when i start the server and following is what i see in server.log

       

      14:52:16,662 WARN  [org.jgroups.stack.DownHandler] (DownHandler (NAKACK)) DownHandler (NAKACK) exception is java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ReadWriteLock
      14:52:16,662 ERROR [stderr] (DownHandler (NAKACK)) java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ReadWriteLock

      14:52:16,662 ERROR [stderr] (DownHandler (NAKACK))  at org.jgroups.protocols.pbcast.NAKACK.setDigest(NAKACK.java:759)

      14:52:16,662 ERROR [stderr] (DownHandler (NAKACK))  at org.jgroups.protocols.pbcast.NAKACK.down(NAKACK.java:248)

      14:52:16,662 ERROR [stderr] (DownHandler (NAKACK))  at org.jgroups.stack.DownHandler.run(Protocol.java:121)

      14:52:16,662 ERROR [stderr] (DownHandler (NAKACK)) Caused by: java.lang.ClassNotFoundException: EDU.oswego.cs.dl.util.concurrent.ReadWriteLock from [Module "deployment.example.war:main" from Service Module Loader]

       

      After going through class loading in AS7(https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7) I understood that AS 7 is loading the following jar(jgroups-3.0.9.Final-redhat-1.jar) from <JBOSS_HOME>\modules\org\jgroups\main

       

      but i have jgroups-all.jar(WEB-INF/lib) in classpath defined.

       

      The reason i am running into this error is org.jgroups.util.NullReadWriteLock class is present in jgroups-all.jar which is part of my classpath(WEB_INF/lib) but not in jgroups-3.0.9.Final-redhat-1.jar which is part of JBoss AS7.

       

       

      How to make JBoss AS7 pick jgroups-all.jar present in the class path instead of jgroups-3.0.9.Final-redhat-1.jar present in from <JBOSS_HOME>\modules\org\jgroups\main.

       

      I added the following in jboss-deployment-structure.xml but it doesn't seem to have any effect.

       

      <jboss-deployment-structure>

        <deployment>   

          <exclusions>   

           <module name="org.jgroups" />

          </exclusions>   

        </deployment> 

      </jboss-deployment-structure>

       

       

      Am i missing something?