Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-1453

MassIndexer fails when no entity is marked for indexing

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.3.0.Final
    • Fix Version/s: None
    • Component/s: massindexer
    • Labels:
      None

      Description

      When building on the ticket monster demo, I found a less than ideal error report.
      If I have 0 entity marked as @Indexed, I get the following error from calling

      ftem.createIndexer().purgeAllOnStart(true).startAndWait();
      
      14:08:58,463 INFO  [org.jboss.jdf.example.ticketmonster.service.Bootstrap] (ServerService Thread Pool -- 51) Indexing entities
      14:08:58,627 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 51) MSC000001: Failed to start service jboss.deployment.unit."ticket-monster.war".component.Bootstrap.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."ticket-monster.war".component.Bootstrap.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
      	at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_21]
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
      	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
      	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
      	at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:118)
      	at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:133)
      	at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	... 7 more
      Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: java.lang.Object is not an indexed entity or a subclass of an indexed entity
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:164)
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:331)
      	at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:57)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	... 11 more
      Caused by: java.lang.IllegalArgumentException: java.lang.Object is not an indexed entity or a subclass of an indexed entity
      	at org.hibernate.search.impl.MassIndexerImpl.toRootEntities(MassIndexerImpl.java:103)
      	at org.hibernate.search.impl.MassIndexerImpl.<init>(MassIndexerImpl.java:75)
      	at org.hibernate.search.impl.DefaultMassIndexerFactory.createMassIndexer(DefaultMassIndexerFactory.java:47)
      	at org.hibernate.search.impl.FullTextSessionImpl.createIndexer(FullTextSessionImpl.java:209)
      	at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.createIndexer(FullTextEntityManagerImpl.java:292)
      	at org.jboss.jdf.example.ticketmonster.service.Bootstrap.onStartup(Bootstrap.java:27)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]
      	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]
      	at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:73)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:226)
      	... 20 more
      

      We probably should detect this corner case and show a nicer error.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              emmanuel Emmanuel Bernard
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: