3 Replies Latest reply on Sep 22, 2014 1:11 AM by hchiorean

    Failing to load jgroups config file

    rwoolf

      Modeshape fails to load the jgroups configuration file.

      I have a web application in which I have embedded Modeshape.  I am using Modeshape 3.8.0.

      I have the following configuration in my Modeshape configuration file.

        "clustering" : {

          "clusterName" : "my-repo-cluster",

          "channelConfiguration" : "/home/ross/conf/jgroups-config.xml"

        }

      I have also tried "file://home/ross/conf/jgroups-config.xml" and "jgroups-config.xml" and with the latter I have put the config file in my WEB-INF folder.

       

      Regardless of what I do I always get the following error:

      java.io.IOException: JGRP000004: parsing failure; the XML document is not correct: InputStream cannot be null

        at org.jgroups.conf.XmlConfigurator.parse(XmlConfigurator.java:173) ~[jgroups-3.2.13.Final.jar:3.2.13.Final]

      ...

      javax.jcr.RepositoryException: Error while starting 'longterm' repository: Cannot create a valid JGroups channel using the configuration: /home/ross/conf/jgroups-config.xml

        at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:650) ~[modeshape-jcr-3.8.0.Final.jar:3.8.0.Final]

       

      For the jgroups-config.xml file I simply copied the configuration from:

      ModeShape in Java applications - ModeShape 3 - Project Documentation Editor

       

      If I change my configuration file to name a non existent file "dummy.xml" then I get the exact same error, so for whatever reason, even though the jgroups-config.xml file exists in the indicated location, it is unable to find or read it.  Rights on the file are such that it is readable by all.

      I even moved this over to a windows machine and the exact problem exists there. 

       

      Is my configuration wrong?  Is there some other way to indicate the exact path in the file system to the indicated file?  I have played with this for almost a day with no success in getting the jgroups-config.xml file to be read.  Just by way of info, I also have my modeshape and infinispan configuration files in this same directory and the app has no problem reading these files from there.

       

      Any help on this would be appreciated.

        • 1. Re: Failing to load jgroups config file
          rhauch

          Did you try putting the file onto your classpath and using a classpath-relative path for 'channelConfiguration'?

          • 2. Re: Failing to load jgroups config file
            rwoolf

            I had prior tried just putting it in the WEB-INF folder, but I just retried it by putting it in the WEB-INF/classes folder and now it successfully finds it.  Is this the only way to load it?  I found older documentation when the modeshape configuration file was XML that stated you could use absolute file system paths and this would be my preferred.

             

            Now that I have this file loading, I have also added  <clustering mode="replication"> <sync/> </clustering> to my infinispan configuration file.  Now I am getting the error

            javax.jcr.RepositoryException: Error while starting 'longterm' repository: Transport should be configured in order to use clustered caches

              at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:650) ~[modeshape-jcr-3.8.0.Final.jar:3.8.0.Final]

             

            Is there something further I need to configure?  BTW - the modeshape documentation said nothing about adding this clustering configuration to the infinispan configuration file, but I found this info at:

            https://wiki.duraspace.org/display/FF/ModeShape+Clustering

            • 3. Re: Failing to load jgroups config file
              hchiorean

              If you want to configure clustering in 3.x, you always need to configure:

              • Infinispan (and via the Infinispan XML configuration JGroups)
              • The ModeShape repository - where at a minimum you just need to set the "clustering"/"clusterName" property and Modeshape will use a default JGroups configuration (or you can specify an external JGroups file).

               

              You can see this in the ModeShape documentation here: ModeShape in Java applications - ModeShape 3 - Project Documentation Editor