3 Replies Latest reply on Aug 25, 2015 10:23 AM by Marcio Ricardo Hatzlhoffer Correia

    Hibernate Search problem in Wildfly 9

    Marcio Ricardo Hatzlhoffer Correia Newbie

      Hello to everyone, I have switched from Wildfly 8.2 to Wildfly 9.0 and after this, the Hibernate Search stopped to work.

      When the Infinispan starts the cluster with indexing, it throws this error below:

      Caused by: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:184)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)
        at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-9.0.1.Final.jar:9.0.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [wildfly-ee-9.0.1.Final.jar:9.0.1.Final]
        ... 11 more
      Caused by: java.lang.LinkageError: Failed to link org/infinispan/hibernate/search/spi/CacheManagerService (Module "org.infinispan.lucene-directory:main" from local module loader @4c1bd4f6 (finder: local module finder @373a8983 (roots: C:\opt\wildfly90-dna\modules,C:\opt\wildfly90-dna\modules\system\layers\base)))
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.Module.loadModuleClass(Module.java:560) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) [jboss-modules.jar:1.4.3.Final]
        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_75]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_75]
        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:269) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.Module.loadModuleClass(Module.java:560) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) [jboss-modules.jar:1.4.3.Final]
        at org.infinispan.query.backend.SearchableCacheConfiguration.initializeProvidedServices(SearchableCacheConfiguration.java:72)
        at org.infinispan.query.backend.SearchableCacheConfiguration.<init>(SearchableCacheConfiguration.java:42)
        at org.infinispan.query.impl.LifecycleManager.getSearchFactory(LifecycleManager.java:264)
        at org.infinispan.query.impl.LifecycleManager.cacheStarting(LifecycleManager.java:107)
        at org.infinispan.factories.ComponentRegistry.notifyCacheStarting(ComponentRegistry.java:230)
        at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:216)
        at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:850)
        at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:599)
        at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:554)
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:424)
        at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:438)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:118)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:109)
        at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:100)
        at uol.dna.services.IspCacheService.init(IspCacheService.java:51)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_75]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_75]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_75]
        at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96) [wildfly-ee-9.0.1.Final.jar:9.0.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)
        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
        at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107) [wildfly-ee-9.0.1.Final.jar:9.0.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28) [wildfly-ee-9.0.1.Final.jar:9.0.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [wildfly-ee-9.0.1.Final.jar:9.0.1.Final]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) [jboss-invocation-1.4.1.Final.jar:1.4.1.Final]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
        ... 27 more
      Caused by: java.lang.NoClassDefFoundError: org/hibernate/search/engine/service/spi/Service
        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_75]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_75]
        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:353) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:432) [jboss-modules.jar:1.4.3.Final]
        ... 88 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.search.engine.service.spi.Service from [Module "org.infinispan.lucene-directory:main" from local module loader @4c1bd4f6 (finder: local module finder @373a8983 (roots: C:\opt\wildfly90-dna\modules,C:\opt\wildfly90-dna\modules\system\layers\base))]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) [jboss-modules.jar:1.4.3.Final]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) [jboss-modules.jar:1.4.3.Final]
        ... 92 more
      
      

       

      The jboss-deployment-structure.xml that works fine in Wildfly 8.2

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
        <deployment>
        <dependencies>
        <module name="org.infinispan" />
        <module name="org.infinispan.query" services="import" export="true" >
        <imports>
           <exclude path="org/infinispan/query/dsl"/>
        </imports>
        </module>   
        <module name="org.infinispan.query.dsl" services="import" export="true" />
        <module name="org.hibernate.search.engine" services="import" export="true" />
        <module name="org.apache.lucene" services="import" export="true" />
        </dependencies>
        </deployment>
      </jboss-deployment-structure>
      
      

       

      The Infinispan configuration that works fine in Wildfly 8.2 and I copied in my Wildfly 9.0 configuration

      <cache-container name="mycache" default-cache="repl" jndi-name="java:jboss/infinispan/mycache" module="org.infinispan.query" statistics-enabled="true" aliases="mycache">
              <transport lock-timeout="60000"/>
                      <replicated-cache name="repl" mode="ASYNC">
                          <transaction mode="NONE"/>
                          <eviction strategy="LRU" max-entries="150000"/>
                          <indexing index="ALL">
                              <property name="default.directory_provider">
                                  ram
                              </property>
                              <property name="hibernate.search.lucene_version">
                                  LATEST
                              </property>
                              <property name="hibernate.search.isp.directory_provider">
                                  infinispan
                              </property>
                              <property name="hibernate.search.isp.worker.backend">
                                  jgroups
                              </property>
                              <property name="hibernate.search.isp.indexwriter.ram_buffer_size">
                                  64
                              </property>
                              <property name="hibernate.search.isp.indexwriter.merge_max_optimize_size">
                                  10
                              </property>
                              <property name="hibernate.search.isp.indexwriter.merge_max_size">
                                  10
                              </property>
                          </indexing>
                          <state-transfer enabled="true" timeout="480000" chunk-size="10240"/>
                      </replicated-cache>
                  </cache-container>
      
      

       

      Please, any suggestions to solve this trouble in Wildfly 9.0?

      Thanks!