-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Master/Slave using JMS
PostPosted: Thu Feb 19, 2015 10:34 am 
Newbie

Joined: Thu Feb 19, 2015 9:57 am
Posts: 1
Hi, I'm desperately trying to replace the current architecture with a master/slave architecture via JMS. The future goal is to have the master running on another machine. However, for the first approach it's fine having the master running on the very same machine.

I'm using
- Tomcat7
- Hibernate 4.3.7
- Hibernate Search 5.0.1.FINAL
- ActiveMQ 5.10

The already existing implementation should be converted as slave. After studying the documentation, I ended up with the following approach to the configuration:
Code:
<!-- Hibernate search configuration -->
<!-- remote and local location of indexes -->
<property name="hibernate.search.default.sourceBase" value="/home/neven/lucene/master" />
<property name="hibernate.search.default.indexBase" value="/home/neven/lucene/indexes" />
<!-- Copy remote index to local index every 10 minutes -->
<property name="hibernate.search.default.refresh" value="600" />
<!-- Directory provider -->
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.impl.FSSlaveDirectoryProvider" />
<!-- JMS backend configuration -->
<property name="hibernate.search.worker.backend" value="jms" />
<property name="hibernate.search.worker.jms.connection_factory" value="tcp://localhost:61616?trace=true" />
<property name="hibernate.search.worker.jms.queue" value="hibernateSearchQueue" />

(Note: the sourceBase and indexBase directories are empty, yet)

When I try to initialize the EntityManagerFactory, the following stracktrace is produced:
Quote:
[ERROR] 2015-02-19 13:39:18.845 [main] EntityManagerFactoryUtil - Unable to create EntityManagerFactory.
javax.persistence.PersistenceException: Unable to build entity manager factory
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) ~[hibernate-jpa-2.1-api-1.0.0.Final.jar:1.0.0.Final]
at cdq.cdl.bpr.database.EntityManagerFactoryUtil.<clinit>(EntityManagerFactoryUtil.java:50) [classes/:?]
at cdq.cdl.bpr.database.GenericCrud.saveEntities(GenericCrud.java:494) [classes/:?]
at cdq.cdl.bpr.database.GenericCrud.saveEntities(GenericCrud.java:544) [classes/:?]
at cdq.cdl.bpr.database.BusinessPartnerService.save(BusinessPartnerService.java:523) [classes/:?]
at cdq.cdl.bpr.TestStresstestInsertions.testNameRequired(TestStresstestInsertions.java:44) [test-classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_31]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_31]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_31]
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) [.cp/:?]
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'cdq.cdl.bpr.datamodel.address.Address'
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:260) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:366) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:204) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:122) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:66) ~[hibernate-search-orm-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:52) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:588) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:852) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:845) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:844) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
... 30 more
Caused by: org.hibernate.search.exception.SearchException: Failed to initialize DirectoryProvider "cdq.cdl.bpr.datamodel.address.Address": could not find marker file in index source
at org.hibernate.search.store.impl.FSSlaveDirectoryProvider.start(FSSlaveDirectoryProvider.java:129) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:88) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:366) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:204) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:122) ~[hibernate-search-engine-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:66) ~[hibernate-search-orm-5.0.1.Final.jar:5.0.1.Final]
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:52) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:588) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:852) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:845) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) ~[hibernate-core-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:844) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) ~[hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
... 30 more


When I revert the changes to the persitence.xml config file (before trying to use JMS), the test runs successfully.

Any ideas or links to a good tutorial (that describes the transition to a master/slave architecture using JMS)?
Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.