When starting an EmbeddedCacheManager from a different module deployed
in the AS, I get this stacktrace:
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 ComponentMetadataRepo is unable to load
"infinispan-core-component-metadata.dat", which contains the
critically-important information for wiring together the internal
components of Infinispan core.
Now I think this is quite silly as locating this resource is trivial:
it's in the same jar as all the infinispan core classes:
infinispan-core-[version].jar so patching this looks like trivial:
it's using the ClassLoader configured as defaultClassLoader in
org.infinispan.factories.AbstractComponentRegistry, but really it
should just use something like
AbstractComponentRegistry.class.getClassLoader() ?
Things get a bit more tricky with extension modules, and a lot of
magic is being wrapped around this defaultClassLoader which goes
beyond my understanding so I would be glad to leave this issue to some
core Infinispan developer more familiar with the intentions here.
Sanne