4 Replies Latest reply on May 7, 2013 11:12 AM by rhauch

    Issue with infinispan json indexStorage cacheConfiguration

    satyakishor.m

      I am using modeshape 3.2 running on jboss eap 6.1. I was trying to setup the infinispan json index configuration and I'm running into the following exception when using a cache configuration file located at classpath.

       

      10:34:04,472 INFO  [org.hibernate.annotations.common.Version] (http-localhost/127.0.0.1:8080-1) HCANN000001: Hibernate Commons Annotations {4.0.1.Final-redhat-2}

      10:34:04,581 ERROR [org.hibernate.search.infinispan.CacheManagerServiceProvider] (http-localhost/127.0.0.1:8080-1) HSEARCH100055: Unable to retrieve CacheManager from JNDI [com/test/jcr/repository/config/cache-config-index]: javax.naming.NameNotFoundException: com/jackson/spa/jerms/jcr/repository/config/infinispan-indexing.xml -- service jboss.naming.context.java.com.jackson.spa.jerms.jcr.repository.config."infinispan-indexing.xml"

                at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)

                at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

                at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:120)

                at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)

                at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

                at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_07]

                at org.hibernate.search.infinispan.CacheManagerServiceProvider.locateCacheManager(CacheManagerServiceProvider.java:114) [hibernate-search-infinispan-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.infinispan.CacheManagerServiceProvider.start(CacheManagerServiceProvider.java:105) [hibernate-search-infinispan-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.engine.impl.StandardServiceManager$ServiceProviderWrapper.startVirtual(StandardServiceManager.java:178) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.engine.impl.StandardServiceManager.requestService(StandardServiceManager.java:124) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.infinispan.impl.InfinispanDirectoryProvider.initialize(InfinispanDirectoryProvider.java:86) [hibernate-search-infinispan-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.store.impl.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:84) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.createDirectoryProvider(DirectoryBasedIndexManager.java:232) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:100) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:227) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:102) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:414) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                     at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                     at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]

                     at org.modeshape.jcr.RepositoryQueryManager.queryEngine(RepositoryQueryManager.java:175) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.RepositoryQueryManager.getIndexes(RepositoryQueryManager.java:161) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.JcrRepository$RepositoryMonitorFactory.indexingMonitor(JcrRepository.java:1801) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.JcrRepository$RepositoryMonitorFactory.createMonitor(JcrRepository.java:1795) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.txn.Transactions.newMonitor(Transactions.java:229) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.txn.Transactions$BaseTransaction.createMonitor(Transactions.java:242) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:373) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:347) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.cache.RepositoryCache.runOneTimeSystemInitializationOperation(RepositoryCache.java:464) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

                     at org.modeshape.jcr.JcrRepository$RunningState.completeInitialization(JcrRepository.java:1234) [modeshape-jcr-3.2.0.Final.jar:3.2.0.Final]

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

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

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

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

       

       

      I believe this issue is fixed in MODE-1870. I also tried to use the absolute path for the cache configuration, in this case I am not running into any exception but index details are not getting persisted in the cache tables.

       

      Following is my json configuration

      {

          "name" : "documentation",

          "jndiName" : "jcr/documentation",

          "storage" : {

              "cacheName" : "CONTENT",

              "cacheConfiguration" : "com/test/jcr/repository/config/cache-config-content.xml",

              "binaryStorage" : {

                  "type" : "cache",

                  "dataCacheName": "BINARY",

                  "metadataCacheName" : "BINARY_META",

                  "cacheConfiguration" : "com/test/jcr/repository/config/cache-config-binary.xml",

                  "minimumBinarySizeInBytes" : 4096

              }

          },

          "query" : {

              "indexStorage" : {

                  "type" : "infinispan",

                  "dataCacheName" : "INDEX",

                  "metadataCacheName" : "INDEX_META",

                  "cacheConfiguration" : "com/test/jcr/repository/config/cache-config-index.xml"           

              },

              "indexing" : {

                        "mode" : "async",

                        "rebuildOnStartup" : {

                                  "when" : "never"

                        }

              }

          }

      }

       

      Is there any thing wrong in the above configuration?

        • 1. Re: Issue with infinispan json indexStorage cacheConfiguration
          rhauch

          If you're running ModeShape 3.2 inside EAP, then you should be configuring the ModeShape repositories and Infinispan caches inside your EAP (formerly AS7) configuration. See our documentation on this subject. (And everywhere you read "AS7" simply think "EAP 6". We're working on changing the documentation over to reference EAP instead.)

          • 2. Re: Issue with infinispan json indexStorage cacheConfiguration
            hchiorean

            Hi,

             

            Some notes/questions:

             

            *) if you're running EAP, you need to use the ModeShape EAP Kit (https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7). You cannot use a JSON file - which is what you would use in embedded/standalone mode. This is because ModeShape needs to be able to integrate with the underlying caching, clustering etc subsystems.

            **) from the version of Hibernate Commons Annotations above, you're using EAP 6.1.0.Beta. The ModeShape EAP kit distributed with 3.2.0 was built & tested on EAP Alpha 1 and since then, there have been a number of updates/fixes to the kit which are needed for EAP Beta. So depending on your context, either a) try running the kit from 3.2.0.Final on EAP Alpha1 or b) using the master branch from GitHub, build a local EAP Beta kit and use that with EAP Beta.

            • 3. Re: Issue with infinispan json indexStorage cacheConfiguration
              satyakishor.m

              If I set up the repositories in standalone.xml file every thing works fine. I just want to let you know guys about the issue with json configuration. Thanks for your quick response.

              • 4. Re: Issue with infinispan json indexStorage cacheConfiguration
                rhauch

                We appreciate the notice, but we strongly discourage people from using a JSON configuration and manually set up a ModeShapeEngine instance (as you would in a regular embedded fashion). When you do this, you're running a different engine instance than what is already running inside EAP+ModeShape. And EAP+ModeShape doesn't actually know about your separate ModeShapeEngine instance, and can't monitory or administer it.