I am trying to implement a JMS backend for Hibernate Search indexing.
Using Spring 2.5, Tomcat 6.0.18 with ActiveMQ 5.2 as JMS Provider.
The post referenced in
https://www.hibernate.org/421.html has been very helpful however I am missing one piece of the puzzle that I cannot figure out.
How do I set the hibernate search worker properties to refer to the Tomcat resources defined.
e.g. I am trying:
Code:
hibernate.search.worker.jms.connection_factory=jms/ConnectionFactory
hibernate.search.worker.jms.queue=queue/hibernatesearch
to refer to the resources defined in:
Code:
<!-- ActiveMQ ConnectionFactory -->
<Resource name="jms/ConnectionFactory" auth="Container" type="org.apache.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://localhost:61616?trace=true" brokerName="LocalActiveMQBroker"/>
<!-- ActiveMQ HibernateSearch queue -->
<Resource name="queue/hibernatesearch" auth="Container" type="org.apache.activemq.command.ActiveMQQueue"
description="Hibernate search queue" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="HibernateSearchController"/>
Unfortunately, I obviously have some sort of disconnect here.
Getting exceptions at startup (truncated):
Code:
Caused by: org.hibernate.search.SearchException: Unable to lookup Search queue (queue/hibernatesearch) and connection factory (jms/ConnectionFactory)
at org.hibernate.search.backend.impl.jms.JMSBackendQueueProcessorFactory.prepareJMSTools(JMSBackendQueueProcessorFactory.java:68)
at org.hibernate.search.backend.impl.jms.JMSBackendQueueProcessorFactory.initialize(JMSBackendQueueProcessorFactory.java:38)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.<init>(BatchedQueueingProcessor.java:101)
at org.hibernate.search.backend.impl.TransactionalWorker.initialize(TransactionalWorker.java:53)
at org.hibernate.search.backend.WorkerFactory.createWorker(WorkerFactory.java:58)
at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:129)
at org.hibernate.search.event.ContextHolder.getOrBuildSearchFactory(ContextHolder.java:30)
at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:59)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
... 130 more
Caused by: javax.naming.NameNotFoundException: Name jms is not bound in this Context
Does anyone know how or have any experience of setting these worker properties to refer to Tomcat defined Resources?
Would be most grateful for any advice.