We're updating the issue view to help you get more done. 

JMS queue initialized too early w/o re-try on failure

Description

Using the JMS backend, if your app is deployed during server start / restart, it fails to start as it can not look up the JMS queue yet. Once it fails, there is no retry and the app must be re-deployed. The queue is not fully deployed until after the hornetq server is started.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 00:58:08,678 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 66) MSC000001: Failed to start service jboss.persistenceunit."dss-slave-sync-1.0-SNAPSHOT.war#testappdb": org.jboss.msc.service.StartException in service jboss.persistenceunit."dss-slave-sync-1.0-SNAPSHOT.war#testappdb": org.hibernate.search.SearchException: HSEARCH000103: Unable to initialize IndexManager com.search.User at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.Final-redhat-1] Caused by: org.hibernate.search.SearchException: HSEARCH000103: Unable to initialize IndexManager com.search.User at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:265) at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:528) at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:495) at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:104) at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:365) at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:219) at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:143) at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:74) at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:52) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:572) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1794) at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99) ... 4 more Caused by: org.hibernate.search.SearchException: HSEARCH000164: Unable to lookup Search queue '/queue/indexupdates' and connection factory 'java:/RemoteConnectionFactory' for index 'com.search.User' at org.hibernate.search.backend.impl.jms.JndiJMSBackendQueueProcessor.initializeJMSQueue(JndiJMSBackendQueueProcessor.java:67) at org.hibernate.search.backend.impl.jms.JmsBackendQueueProcessor.initialize(JmsBackendQueueProcessor.java:79) at org.hibernate.search.backend.BackendFactory.createBackend(BackendFactory.java:85) at org.hibernate.search.backend.BackendFactory.createBackend(BackendFactory.java:53) at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.createBackend(DirectoryBasedIndexManager.java:204) at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:102) at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:261) ... 21 more Caused by: javax.naming.NameNotFoundException: queue/indexupdates -- service jboss.naming.context.java.queue.indexupdates at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197) at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:120) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179) at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_60] at org.hibernate.search.backend.impl.jms.JndiJMSBackendQueueProcessor.initializeJMSQueue(JndiJMSBackendQueueProcessor.java:64) ... 27 more 00:58:17,497 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 67) HQ221003: trying to deploy queue jms.queue.IndexingQueue 00:58:17,503 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 67) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queue/indexupdates 00:58:17,503 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 67) JBAS011601: Bound messaging object to jndi name java:/queue/indexupdates 00:58:17,833 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report JBAS014777: Services which failed to start: service jboss.persistenceunit."dss-slave-sync-1.0-SNAPSHOT.war#testappdb": org.jboss.msc.service.StartException in service jboss.persistenceunit."dss-slave-sync-1.0-SNAPSHOT.war#testappdb": org.hibernate.search.SearchException: HSEARCH000103: Unable to initialize IndexManager com.search.User

Environment

None

Status

Assignee

Unassigned

Reporter

Matt Robson

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Critical