Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3032

Use both context and class' class loader when reading component metadata

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 5.3.0.Final
    • 6.0.0.Final
    • None
    • None

    Description

      Caused by: org.hibernate.search.SearchException: Unable to initialize
      directory provider:
      org.hibernate.search.test.integration.jbossas7.model.Member
      at org.hibernate.search.store.impl.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:87)
      at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.createDirectoryProvider(DirectoryBasedIndexManager.java:232)
      at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:100)
      at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:227)
      ... 19 more
      Caused by: org.infinispan.config.ConfigurationException:
      org.infinispan.CacheException: Unable to load component metadata!
      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:386)
      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:341)
      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:328)
      at org.hibernate.search.infinispan.CacheManagerServiceProvider.start(CacheManagerServiceProvider.java:93)
      at org.hibernate.search.engine.impl.StandardServiceManager$ServiceProviderWrapper.startVirtual(StandardServiceManager.java:178)
      at org.hibernate.search.engine.impl.StandardServiceManager.requestService(StandardServiceManager.java:124)
      at org.hibernate.search.infinispan.impl.InfinispanDirectoryProvider.initialize(InfinispanDirectoryProvider.java:86)
      at org.hibernate.search.store.impl.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:84)
      ... 22 more
      Caused by: org.infinispan.CacheException: Unable to load component metadata!
      at org.infinispan.factories.components.ComponentMetadataRepo.initialize(ComponentMetadataRepo.java:131)
      at org.infinispan.factories.GlobalComponentRegistry.<init>(GlobalComponentRegistry.java:103)
      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:381)
      ... 29 more
      Caused by: java.lang.NullPointerException
      at org.infinispan.factories.components.ComponentMetadataRepo.readMetadata(ComponentMetadataRepo.java:53)
      at org.infinispan.factories.components.ComponentMetadataRepo.initialize(ComponentMetadataRepo.java:129)
      ... 31 more

      The exception above is caused by Infinispan using (by default) invocation context's ClassLoader when trying to read the component metadata. In a modularized environment such as AS7 this will cause the metadata not to be found (metadata is packaged in the same jar as the infinispan class that reads it). In order to overcome this problem we should try to use both class' ClassLoader and InvocationContxt's class loader when trying to read the metadata.
      Workaround: set the class loader on the GlobalConfiguration object:

      GlobalConfiguration.classLoader( GlobalConfiguration.class.getClassLoder())
      

      Attachments

        Activity

          People

            ttarrant@redhat.com Tristan Tarrant
            mircea.markus Mircea Markus (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: