2 Replies Latest reply on Feb 22, 2013 9:29 AM by rhauch

    Error while integrating modeshape 2.8.x with JGroups3.x

    neil.zou

      I'm now using modeshape 2.8.2, we need to use modeshape cluster feature. JGroups-3.0.9 is already used in system, so we removed jgroups dependency while adding modeshape clusting jar:

       

      <dependency>
        <groupId>org.modeshape</groupId>
        <artifactId>modeshape-clustering</artifactId>
        <version>${modeshape.version}</version>
          <exclusions>
            <exclusion>
              <groupId>org.jgroups</groupId>
              <artifactId>jgroups</artifactId>
            </exclusion>
          </exclusions>
      </dependency>
      

      And I updated the jgroups configuration file as JGroups3 style, details attached.

       

      But while we starting application, got below error, does modeshape 2.8.X only support JGroups 2?

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modeshapeFactory' defined in URL [......]: Invocation of init method failed; nested exception is org.modeshape.common.SystemFailureException: java.lang.NoClassDefFoundError: org/jgroups/ChannelClosedException
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
        ... 76 more
      Caused by: org.modeshape.common.SystemFailureException: java.lang.NoClassDefFoundError: org/jgroups/ChannelClosedException
        at org.modeshape.common.component.ComponentLibrary.newInstance(ComponentLibrary.java:318)
        at org.modeshape.common.component.ComponentLibrary.add(ComponentLibrary.java:165)
        at org.modeshape.common.component.ComponentLibrary.removeAllAndAdd(ComponentLibrary.java:248)
        at org.modeshape.repository.cluster.ClusteringService.setClusteringConfig(ClusteringService.java:122)
        at org.modeshape.repository.ModeShapeEngine.<init>(ModeShapeEngine.java:142)
        at org.modeshape.jcr.JcrEngine.<init>(JcrEngine.java:111)
        at org.modeshape.jcr.JcrConfiguration.build(JcrConfiguration.java:550)
        at com.test.MsClientFactory.startRepositories(MsClientFactory.java:167)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
        ... 83 more
      Caused by: java.lang.NoClassDefFoundError: org/jgroups/ChannelClosedException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.modeshape.common.component.ComponentLibrary.newInstance(ComponentLibrary.java:303)
        ... 97 more
      Caused by: java.lang.ClassNotFoundException: org.jgroups.ChannelClosedException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
        ... 100 more
      
        • 1. Re: Error while integrating modeshape 2.8.x with JGroups3.x
          neil.zou

          I check modeshape source code again.

          Found below code, so I guess this issue can't be resolved by configuration change..

           

          import java.io.ByteArrayInputStream;
          import java.io.IOException;
          import java.io.InputStream;
          import java.util.concurrent.atomic.AtomicBoolean;
          import org.jgroups.Address;
          import org.jgroups.Channel;
          import org.jgroups.ChannelClosedException;
          import org.jgroups.ChannelException;
          import org.jgroups.ChannelListener;
          import org.jgroups.ChannelNotConnectedException;
          import org.jgroups.JChannel;
          import org.jgroups.Message;
          import org.jgroups.View;
          import org.jgroups.conf.ProtocolStackConfigurator;
          import org.jgroups.conf.XmlConfigurator;
          import org.jgroups.util.Util;
          import org.modeshape.common.SystemFailureException;
          import org.modeshape.common.util.CheckArg;
          import org.modeshape.common.util.Logger;
          import org.modeshape.graph.observe.ChangeObservers;
          import org.modeshape.graph.observe.Changes;
          import org.modeshape.graph.observe.ObservationBus;
          import org.modeshape.graph.observe.Observer;
          
          
          /**
           * An implementation of a cluster-aware {@link ObservationBus}.
           */
          public class ClusteredObservationBus implements ObservationBus {
          ...
          
          • 2. Re: Error while integrating modeshape 2.8.x with JGroups3.x
            rhauch

            does modeshape 2.8.X only support JGroups 2?

            As you might have guessed, ModeShape 2.8 requires JGroups 2.10.0.GA. Not only have we not even tested other versions of JGroups 2, but as you noticed it probably won't even compile against JGroups 3 (major releases often entail an API change).