5 Replies Latest reply on May 1, 2011 6:39 AM by Romain Cherchi

    Seam 2.2.1.Final and lucene 2.9.4 or 3.0.3

    Romain Cherchi Newbie

      Hello,


      I need to use lucene-spatial for my project which is available only since lucene 2.9.4 or 3.0.3. I'm migrating to Seam 2.2.1.Final which uses hibernate 3.3.1.GA and hibernate search 3.1.1.GA. By default, lucene 2.4 in installed.


      Can I easily upgrade lucene to 2.9.4 or upper (just by replacing the jar files) or is there some incompatibility issues ?


      When I try to do that, I have the following issue  :




      2011-04-29 15:24:33,213 WARN  [org.jboss.system.ServiceController] Problem starting service persistence.units:ear=easycity.ear,jar=easycity.jar,unitName=easycity
      java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
           at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:109)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
           at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
           at $Proxy0.start(Unknown Source)
           at org.jboss.system.ServiceController.start(ServiceController.java:417)
           at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
           at $Proxy56.start(Unknown Source)
           at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
           at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:627)
           at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:351)
           at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
           at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
           at $Proxy0.start(Unknown Source)
           at org.jboss.system.ServiceController.start(ServiceController.java:417)
           at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
           at $Proxy33.start(Unknown Source)
           at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
           at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
           at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
           at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
           at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
           at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
           at $Proxy34.start(Unknown Source)
           at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
           at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
           at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
           at $Proxy9.deploy(Unknown Source)
           at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
           at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
           at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
           at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
           at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
           at $Proxy0.start(Unknown Source)
           at org.jboss.system.ServiceController.start(ServiceController.java:417)
           at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
           at $Proxy4.start(Unknown Source)
           at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
           at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
           at $Proxy5.deploy(Unknown Source)
           at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
           at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
           at org.jboss.Main.boot(Main.java:200)
           at org.jboss.Main$1.run(Main.java:508)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
           at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:99)
           at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:356)
           at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1304)
           at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
           at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
           at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
           at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
           ... 138 more
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.apache.lucene.analysis.standard.StandardAnalyzer
           at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
           ... 150 more



      and


      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:ear=easycity.ear,jar=easycity.jar,unitName=easycity
        State: FAILED
        Reason: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
        I Depend On:
          jboss.jca:service=DataSourceBinding,name=easycityDatasource
        Depends On Me:





      Thanks for your help.
      Romain


        • 1. Re: Seam 2.2.1.Final and lucene 2.9.4 or 3.0.3
          Aldo Bonzi Novice

          It seems you are not deploying all the required libs. Is lucene-core.jar already in your deployed-jars-ear.list?

          • 2. Re: Seam 2.2.1.Final and lucene 2.9.4 or 3.0.3
            Romain Cherchi Newbie

            Thanks for your help Aldo.


            I don't use deployed-jars-ear.list but I have includes in my build.xml




            <copy todir="${ear.dir}/lib">
                        <fileset dir="${lib.dir}">
                            <includesfile name="deployed-jars-ear.list"/>
                             
                             <!-- Hibernate Search -->
            <include name="lucene-core-2.9.4.jar"/>
                             <include name="hibernate-search.jar"/>
                             <include name="hibernate-commons-annotations.jar"/>
            
            ...etc
                            
            



            lucene-core-2.9.4.jar ends up deployed in my EAR/lib folder. I also tried to edit the deployed-jars-ear.list but I get the same issue.

            • 3. Re: Seam 2.2.1.Final and lucene 2.9.4 or 3.0.3
              Romain Cherchi Newbie

              The error is issued when I add these required properties to my persistence.xml



                         <property      name="hibernate.ejb.event.post-insert" 
                                       value="org.hibernate.search.event.FullTextIndexEventListener"/>
                         <property      name="hibernate.ejb.event.post-update" 
                                   value="org.hibernate.search.event.FullTextIndexEventListener"/>
                          <property      name="hibernate.ejb.event.post-delete" 
                                   value="org.hibernate.search.event.FullTextIndexEventListener"/>
              



              It occurs when I boot Jboss.

              • 4. Re: Seam 2.2.1.Final and lucene 2.9.4 or 3.0.3
                Romain Cherchi Newbie

                I really start to wonder if lucene 2.9.4 is compatible with hibernate search 3.1.1.GA. Now jboss boots ok but I get this error when i try to get a full text session :




                2011-05-01 12:32:55,703 WARN  [org.jboss.seam.persistence.HibernatePersistenceProvider] Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned
                java.lang.reflect.InvocationTargetException
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.seam.persistence.HibernatePersistenceProvider.proxySession(HibernatePersistenceProvider.java:135)
                     at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyDelegate(HibernatePersistenceProvider.java:165)
                     at org.jboss.seam.persistence.EntityManagerInvocationHandler.handleGetDelegate(EntityManagerInvocationHandler.java:81)
                     at org.jboss.seam.persistence.EntityManagerInvocationHandler.invoke(EntityManagerInvocationHandler.java:40)
                     at $Proxy266.getDelegate(Unknown Source)
                     at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.getDelegate(FullTextEntityManagerImpl.java:165)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                     at org.jboss.seam.persistence.EntityManagerInvocationHandler.handleGetDelegate(EntityManagerInvocationHandler.java:81)
                     at org.jboss.seam.persistence.EntityManagerInvocationHandler.invoke(EntityManagerInvocationHandler.java:40)
                     at $Proxy267.getDelegate(Unknown Source)
                     at com.easycity.ejb.util.IndexerBean.getFullTextSession(IndexerBean.java:161)
                     at com.easycity.ejb.util.IndexerBean.indexPOI(IndexerBean.java:88)
                     at com.easycity.ejb.util.IndexerBean.index(IndexerBean.java:65)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:597)
                ...
                





                Caused by: java.lang.NoClassDefFoundError: org/hibernate/event/PostCollectionRecreateEventListener
                     at java.lang.ClassLoader.defineClass1(Native Method)
                     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
                     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
                     at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
                     at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
                     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
                     at java.security.AccessController.doPrivileged(Native Method)
                     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                     at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:690)
                     at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:670)
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:200)
                     at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
                     at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:527)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                     at org.hibernate.search.backend.impl.EventSourceTransactionContext.getIndexWorkFlushEventListener(EventSourceTransactionContext.java:80)
                     at org.hibernate.search.backend.impl.EventSourceTransactionContext.<init>(EventSourceTransactionContext.java:41)
                     at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:75)
                     at org.hibernate.search.Search.getFullTextSession(Search.java:23)
                     ... 231 more
                Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.hibernate.event.PostCollectionRecreateEventListener
                     at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                     ... 253 more



                This occurs when I do :


                     private FullTextSession getFullTextSession() {
                          return (FullTextSession) em.getDelegate();
                     }
                



                Thanks for your help.
                Romain







                • 5. Re: Seam 2.2.1.Final and lucene 2.9.4 or 3.0.3
                  Romain Cherchi Newbie

                  Found a related issue on hibernate forum My Link


                  Lucene 2.9 was unsupported on version 3.1 of Hibernate Search, you better stick to Lucene 2.4.1 ???