5 Replies Latest reply on Apr 14, 2015 10:31 AM by hchiorean

    ModeShape repository data corrupted-can it be recovered?

    m.jawwad

      Hi,

       

           I am using ModeShape 4.0.0 Final in our web application on Tomcat. The repository seemed to be working fine untill yesterday and we had some precious data inside ModeShape,

       

      The server threw the following exception during restart:

       

      Error while starting 'DataRepository' repository: 86cfc44317f1e7/jcr:system/mode:indexes/local/index

       

      2015-04-09 18:51:58.118 INFO  [main] SLF4JLoggerImpl.java:182      ModeShape version 4.0.0.Final
      2015-04-09 18:52:02.260 ERROR [main] SLF4JLoggerImpl.java:166      Error while refreshing index definitions for the "DataRepository" repository

      java.lang.NullPointerException: null

          at org.modeshape.jcr.SystemContent.readIndexDefinition(SystemContent.java:516) ~[modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.SystemContent.readAllIndexDefinitions(SystemContent.java:572) ~[modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.RepositoryIndexManager.readIndexDefinitions(RepositoryIndexManager.java:747) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.RepositoryIndexManager.register(RepositoryIndexManager.java:318) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.RepositoryIndexManager.<init>(RepositoryIndexManager.java:134) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.RepositoryQueryManager.<init>(RepositoryQueryManager.java:86) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1204) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:977) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:386) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

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

          at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:611) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

          at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:143) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]

      ...

      ...

      ...

      Error while starting 'DataRepository' repository: 86cfc44317f1e7/jcr:system/mode:indexes/local/index

      ------------------------------------------------------------

       

       

      I tried removing and regenerating the indexes but the exception is still there whenever the server starts and the repository is deployed. My DataRepository.json file is also attached.

       

      Can anyone please help?

       

      Regards,

       

      Jawwad Muzaffar

        • 1. Re: ModeShape repository data corrupted-can it be recovered?
          hchiorean

          Can you please try using 4.2.0.Final ? 4.0.0.Final is an old version and we've fixed numerous bugs since then. If you still see the issue, can you provide some sample code we can look at to track it down ?

          The exception itself would seem to indicate that the /jcr:system/mode:indexes area (which is stored in Infinispan) has become corrupted somehow. There's not much more I can tell based on a post-mortem.

          • 2. Re: ModeShape repository data corrupted-can it be recovered?
            m.jawwad

            Hi,

             

              Thanks for the response, I tried the latest release Modeshape 4.2.0 but the issue is still the same. Below is the code thats used to deploy the repository:

             

            RepositoryConfiguration config = RepositoryConfiguration.read("DataRepository.json");
            repository = engine.deploy(config);   //engine is the instance of ModeShapeEngine
            repository.login(); //this throws the above NullpointerException
            

             

             

            For your reference I am also providing the repository *.dat and all the configuration files. Please help, Thanks


             


             


             

            • 3. Re: ModeShape repository data corrupted-can it be recovered?
              hchiorean

              The Infinispan data that you have (the .dat file) is *already* corrupted. There's nothing that can be done about that. Can you reproduce the steps required to actually corrupt the data ? If yes, that's something which we can investigate and if there's a bug try to fix it.

              • 4. Re: ModeShape repository data corrupted-can it be recovered?
                m.jawwad

                Hi,

                 

                 

                     ok, I think this has happened somewhere stopping the tomcat server  I am trying to reproduce the scenario. Actually, the repos are deployed (using the above mentioned code)  at tomcat startup and the repos are shutdown when the server is stopped. Is there a way for us to see modeshape event logs?

                 

                 

                     Moreover, are there any suggestions or recommended configurations that can be make ModeShape more resilient & stable?

                • 5. Re: ModeShape repository data corrupted-can it be recovered?
                  hchiorean

                  The overall configuration looks fine; the only thing which shouldn't really be there is Infinispan's transaction manager: transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup". In a real system, you should be using a real tx manager (e.g. JBoss JTA). However, I don't necessarily think that is the cause for the problem you're seeing.

                  So ideally you should try reproducing the problem using 4.2.0.Final and this configuration.