11 Replies Latest reply on Jan 29, 2018 2:05 AM by Gourav Singh

    Hibernate-Search, Infinispan (running in multiple instances)

    Nadeem Pasha Newbie

      Hello,

       

      When i try to execute the application/program in 2 machines at the same time, 2 scenarios occurred,

      scenario-1: one process waits till the other process to get complete, and then the other one starts and it will get completed, and when i run search on both machines, i am able to see both the insertions.

      scenario-2: In this scenario both the process finishes at the same time, and when i search on both machines, i am able to get only one of the data inserted(which is random of 2) and other data is lost without throwing any exception.

      Also when i insert and search in the same process, then i can see the inserted data but it is not persisted in the index database.

       

      My persistence.xml file is

      <?xml version="1.0" encoding="UTF-8" ?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">

      <persistence-unit name="IC" transaction-type="RESOURCE_LOCAL">

      <class>com.csgsol.model.Course</class>

      <properties>

      <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>

      <property name="javax.persistence.jdbc.url" value="jdbc:mysql://192.168.1.52:3306/abc"/>

      <property name="javax.persistence.jdbc.user" value="my-un"/>

      <property name="javax.persistence.jdbc.password" value="my-pwd"/>

       

      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>

      <property name="hibernate.hbm2ddl.auto" value="update"/>

       

      <property name="hibernate.search.default.directory_provider" value="infinispan"/>

      <property name="hibernate.search.default.indexmanager" value="near-real-time"/>

      <property name="hibernate.search.default.exclusive_index_use" value="false"/>

      <property name="hibernate.search.default.worker.execution" value = "async"/>

      <property name="hibernate.search.lucene_version" value="LUCENE_4_10_4"/>

      <property name="hibernate.search.default.worker.thread_pool.size" value="2"/>

      <property name="hibernate.search.default.worker.buffer_queue.size" value="50"/>

      <property name="hibernate.search.infinispan.configuration_resourcename" value="infinispan.xml"/>

      </properties>

      </persistence-unit>

      </persistence>

       

      my infinispan.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <infinispan

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="urn:infinispan:config:7.2 http://www.infinispan.org/schemas/infin ... ig-7.2.xsd

      urn:infinispan:config:store:jdbc:7.2 http://www.infinispan.org/schemas/infin ... ig-7.2.xsd"

      xmlns="urn:infinispan:config:7.2"

      xmlns:jdbc="urn:infinispan:config:store:jdbc:7.2">

       

      <!-- *************************** -->

      <!-- System-wide global settings -->

      <!-- *************************** -->

      <jgroups>

      <!-- Note that the JGroups transport uses sensible defaults if no configuration

      property is defined. See the JGroupsTransport javadocs for more flags.

      jgroups-udp.xml is the default stack bundled in the Infinispan core jar: integration

      and tuning are tested by Infinispan. -->

      <stack-file name="default-jgroups-tcp" path="default-jgroupsTcp.xml"/>

      </jgroups>

       

      <cache-container name="HibernateSearch" default-cache="default" statistics="false" shutdown-hook="DONT_REGISTER">

       

      <transport stack="default-jgroups-tcp"/>

       

      <!-- Duplicate domains are allowed so that multiple deployments with default configuration

      of Hibernate Search applications work - if possible it would be better to use JNDI to share

      the CacheManager across applications -->

      <jmx duplicate-domains="true"/>

       

      <!-- *************************************** -->

      <!-- Cache to store Lucene's file metadata -->

      <!-- *************************************** -->

      <replicated-cache name="LuceneIndexesMetadata" mode="SYNC" remote-timeout="25000">

      <locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>

      <transaction mode="NONE" />

      <eviction max-entries="-1" strategy="NONE"/>

      <expiration max-idle="-1"/>

      <persistence passivation="false" >

      <!--<cluster-loader remote-timeout="15000" preload="true"/>-->

      <jdbc:string-keyed-jdbc-store preload="true" shared="true" fetch-state="true" read-only="false" purge="false">

      <write-behind modification-queue-size="1024" thread-pool-size="23" flush-lock-timeout="1"

      shutdown-timeout="75000"/>

      <property name="key2StringMapper">org.infinispan.lucene.LuceneKey2StringMapper</property>

      <jdbc:connection-pool connection-url="jdbc:mysql://192.168.1.52:3306/hsearch"

      driver="com.mysql.jdbc.Driver" username="my-un"

      password="my-pwd"></jdbc:connection-pool>

      <jdbc:string-keyed-table drop-on-exit="false" create-on-start="true" prefix="ISPN_STRING_TABLE">

      <jdbc:id-column name="ID" type="VARCHAR(255)"/>

      <jdbc:data-column name="DATA" type="MEDIUMBLOB"/>

      <jdbc:timestamp-column name="TIMESTAMP" type="BIGINT"/>

      </jdbc:string-keyed-table>

      </jdbc:string-keyed-jdbc-store>

      </persistence>

      <indexing index="ALL"/>

      <state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>

      </replicated-cache>

       

       

       

       

      <!-- **************************** -->

      <!-- Cache to store Lucene data -->

      <!-- **************************** -->

      <replicated-cache name="LuceneIndexesData" mode="SYNC" remote-timeout="25000">

      <locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>

      <transaction mode="NONE"/>

      <eviction max-entries="-1" strategy="NONE"/>

      <expiration max-idle="-1"/>

       

      <persistence passivation="false">

      <!--<cluster-loader remote-timeout="15000" preload="true"/>-->

      <jdbc:string-keyed-jdbc-store preload="true" shared="true" fetch-state="true" read-only="false" purge="false">

      <write-behind modification-queue-size="1024" thread-pool-size="23" flush-lock-timeout="1"

      shutdown-timeout="75000" />

      <property name="key2StringMapper">org.infinispan.lucene.LuceneKey2StringMapper</property>

      <jdbc:connection-pool connection-url="jdbc:mysql://192.168.1.52:3306/hsearch"

      driver="com.mysql.jdbc.Driver" username="my-un"

      password="my-pwd"></jdbc:connection-pool>

       

      <jdbc:string-keyed-table drop-on-exit="false" create-on-start="true" prefix="ISPN_STRING_TABLE">

      <jdbc:id-column name="ID" type="VARCHAR(255)"/>

      <jdbc:data-column name="DATA" type="MEDIUMBLOB"/>

      <jdbc:timestamp-column name="TIMESTAMP" type="BIGINT"/>

      </jdbc:string-keyed-table>

      </jdbc:string-keyed-jdbc-store>

      </persistence>

      <indexing index="ALL"/>

      <state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>

      </replicated-cache>

       

      <!-- ***************************** -->

      <!-- Cache to store Lucene locks -->

      <!-- ***************************** -->

      <replicated-cache name="LuceneIndexesLocking">

      <locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>

      <transaction mode="NONE"/>

      <eviction max-entries="-1" strategy="NONE"/>

      <expiration max-idle="-1"/>

      <indexing index="ALL"/>

      <state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>

      </replicated-cache>

      </cache-container>

       

      </infinispan>

        • 1. Re: Hibernate-Search, Infinispan (running in multiple instances)
          Gustavo Fernandes Apprentice

          When using Hibernate Search with and Infinispan Directory, you must guarantee that only one node writes to index at a time, as writes in Lucene cause the whole index to lock.

          https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#_architecture

           

          Scenario 1 is probably caused by the fact you used "exclusive_index_use", this causes each node that is writing to the index to open and close the index and other nodes that are trying to

          write at the same time to wait, thus causing competition for the lock.

           

          Can't say exactly what is causing the behaviour of scenario 2, do you have DEBUG logs to provide?

           

          The bottom line is, you'll have issues with Hibernate Search in multiple machines using the Infinispan Directory, since the index will be a single index for all nodes, and only one node can write to the index

          at a time. How to "fix" this? There are a few choices:

           

          * You application guarantees that only 1 node will write to the index, or one node at a time at least;

          * You use a different hibernate search backend together with the Infinispan Directory, such as JMS and JGroups

          https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#jms-backend

          https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#jgroups-backend

           

          Those two backends above work similarly: they elect a master node in you cluster, so whenever a node in you application does some write,

          it is sent to that 'master' to be written to the index. The 'master' always hold the lock to the index, and applies some optimizations as batching, so you get

          a better throughtput than having each of you local node competing for the lock

          • 2. Re: Hibernate-Search, Infinispan (running in multiple instances)
            Nadeem Pasha Newbie

            Thanks for the reply,

            i removed "org.infinispan.query.indexmanager.InfinispanIndexManager",

            also i am providing my own jgroup file.

             

            <config xmlns="urn:org:jgroups"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.6.xsd">

               <TCP bind_addr="${jgroups.tcp.address:192.168.1.48}"
               bind_port="${jgroups.tcp.port:7800}"
               enable_diagnostics="false"
               thread_naming_pattern="pl"
               send_buf_size="640k"
               sock_conn_timeout="300"

               thread_pool.min_threads="${jgroups.thread_pool.min_threads:2}"
               thread_pool.max_threads="${jgroups.thread_pool.max_threads:30}"
               thread_pool.keep_alive_time="60000"
               thread_pool.queue_enabled="false"

               internal_thread_pool.min_threads="${jgroups.internal_thread_pool.min_threads:5}"
               internal_thread_pool.max_threads="${jgroups.internal_thread_pool.max_threads:20}"
               internal_thread_pool.keep_alive_time="60000"
               internal_thread_pool.queue_enabled="true"
               internal_thread_pool.queue_max_size="500"

               oob_thread_pool.min_threads="${jgroups.oob_thread_pool.min_threads:20}"
               oob_thread_pool.max_threads="${jgroups.oob_thread_pool.max_threads:200}"
               oob_thread_pool.keep_alive_time="60000"
               oob_thread_pool.queue_enabled="false"
               />

               <MPING bind_addr="${jgroups.tcp.address:192.168.1.48}"
               mcast_addr="${jgroups.mping.mcast_addr:228.2.4.6}"
               mcast_port="${jgroups.mping.mcast_port:43366}"
               ip_ttl="${jgroups.udp.ip_ttl:2}"
               />

               <MERGE3 min_interval="10000"
               max_interval="30000"
               />

               <FD_SOCK />

               <FD_ALL timeout="60000"
               interval="15000"
               timeout_check_interval="5000"
               />

               <VERIFY_SUSPECT timeout="5000" />

               <pbcast.NAKACK2 use_mcast_xmit="false"
               xmit_interval="1000"
               xmit_table_num_rows="50"
               xmit_table_msgs_per_row="1024"
               xmit_table_max_compaction_time="30000"
               max_msg_batch_size="100"
               resend_last_seqno="true"
               />

               <UNICAST3 xmit_interval="500"
               xmit_table_num_rows="50"
               xmit_table_msgs_per_row="1024"
               xmit_table_max_compaction_time="30000"
               max_msg_batch_size="100"
               conn_expiry_timeout="0"
               />

               <pbcast.STABLE stability_delay="500"
               desired_avg_gossip="5000"
               max_bytes="1M"
               />

               <pbcast.GMS print_local_addr="false"
               join_timeout="15000"
               />

               <pbcast.FLUSH />

               <MFC max_credits="2m"
               min_threshold="0.40"
               />

               <FRAG2 />

            </config>

             

             

            the logs are,

             

            "C:\Program Files\Java\jdk1.8.0_91\bin\java" -Djava.net.preferIPv4Stack=true "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2\lib\idea_rt.jar=59048:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_91\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_91\jre\lib\rt.jar;E:\infinispancluster\target\classes;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\mysql\mysql-connector-java\5.1.35\mysql-connector-java-5.1.35.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\logging\log4j\log4j-core\2.9.0\log4j-core-2.9.0.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\logging\log4j\log4j-api\2.9.0\log4j-api-2.9.0.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\com\opencsv\opencsv\3.3\opencsv-3.3.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-search-orm\5.2.0.Final\hibernate-search-orm-5.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-search-engine\5.2.0.Final\hibernate-search-engine-5.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\lucene\lucene-core\4.10.4\lucene-core-4.10.4.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\lucene\lucene-analyzers-common\4.10.4\lucene-analyzers-common-4.10.4.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\lucene\lucene-facet\4.10.4\lucene-facet-4.10.4.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\lucene\lucene-queries\4.10.4\lucene-queries-4.10.4.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-core\4.3.9.Final\hibernate-core-4.3.9.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jboss\jandex\1.1.0.Final\jandex-1.1.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-entitymanager\4.3.9.Final\hibernate-entitymanager-4.3.9.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jboss\logging\jboss-logging\3.1.3.GA\jboss-logging-3.1.3.GA.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jboss\logging\jboss-logging-annotations\1.2.0.Beta1\jboss-logging-annotations-1.2.0.Beta1.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\common\hibernate-commons-annotations\4.0.5.Final\hibernate-commons-annotations-4.0.5.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\javax\persistence\hibernate-jpa-2.1-api\1.0.0.Final\hibernate-jpa-2.1-api-1.0.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jboss\spec\javax\transaction\jboss-transaction-api_1.2_spec\1.0.0.Final\jboss-transaction-api_1.2_spec-1.0.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.8.5\jackson-core-2.8.5.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-search-infinispan\5.2.0.Final\hibernate-search-infinispan-5.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-lucene-directory\7.2.0.Final\infinispan-lucene-directory-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-cachestore-jdbc\7.2.0.Final\infinispan-cachestore-jdbc-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-core\7.2.0.Final\infinispan-core-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-commons\7.2.0.Final\infinispan-commons-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jboss\spec\javax\transaction\jboss-transaction-api_1.1_spec\1.0.1.Final\jboss-transaction-api_1.1_spec-1.0.1.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jboss\marshalling\jboss-marshalling-osgi\1.4.10.Final\jboss-marshalling-osgi-1.4.10.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.0.0\jackson-databind-2.0.0.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.0.0\jackson-annotations-2.0.0.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\c3p0\c3p0\0.9.1.2\c3p0-0.9.1.2.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-query\7.2.0.Final\infinispan-query-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-query-dsl\7.2.0.Final\infinispan-query-dsl-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-objectfilter\7.2.0.Final\infinispan-objectfilter-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hql\hibernate-hql-parser\1.1.0.Final\hibernate-hql-parser-1.1.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hql\hibernate-hql-lucene\1.1.0.Final\hibernate-hql-lucene-1.1.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\infinispan\infinispan-directory-provider\7.2.0.Final\infinispan-directory-provider-7.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-search-engine\5.2.0.Beta1\hibernate-search-engine-5.2.0.Beta1-tests.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-search-serialization-avro\5.2.0.Beta1\hibernate-search-serialization-avro-5.2.0.Beta1.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\avro\avro\1.7.6\avro-1.7.6.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\com\thoughtworks\paranamer\paranamer\2.3\paranamer-2.3.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\apache\commons\commons-compress\1.4.1\commons-compress-1.4.1.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\hibernate\hibernate-search-backend-jgroups\5.2.0.Final\hibernate-search-backend-jgroups-5.2.0.Final.jar;C:\Users\nadeem.pasha.CSGSOL\.m2\repository\org\jgroups\jgroups\3.6.2.Final\jgroups-3.6.2.Final.jar" com.csgsol.TestRig data-2.txt Compute9

            Jan 10, 2018 5:33:46 PM org.hibernate.ejb.HibernatePersistence logDeprecation

            WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.

            Jan 10, 2018 5:33:46 PM org.hibernate.ejb.HibernatePersistence logDeprecation

            WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.

            Jan 10, 2018 5:33:46 PM org.hibernate.ejb.HibernatePersistence logDeprecation

            WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.

            Jan 10, 2018 5:33:46 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation

            INFO: HHH000204: Processing PersistenceUnitInfo [

            name: IC

            ...]

            Jan 10, 2018 5:33:47 PM org.hibernate.Version logVersion

            INFO: HHH000412: Hibernate Core {4.3.9.Final}

            Jan 10, 2018 5:33:47 PM org.hibernate.cfg.Environment <clinit>

            INFO: HHH000206: hibernate.properties not found

            Jan 10, 2018 5:33:47 PM org.hibernate.cfg.Environment buildBytecodeProvider

            INFO: HHH000021: Bytecode provider name : javassist

            Jan 10, 2018 5:33:47 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>

            INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}

            Jan 10, 2018 5:33:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

            WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)

            Jan 10, 2018 5:33:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

            INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://192.168.1.52:3306/csg]

            Jan 10, 2018 5:33:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

            INFO: HHH000046: Connection properties: {user=pf_user, password=****}

            Jan 10, 2018 5:33:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

            INFO: HHH000006: Autocommit mode: false

            Jan 10, 2018 5:33:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

            INFO: HHH000115: Hibernate connection pool size: 20 (min=1)

            Jan 10, 2018 5:33:48 PM org.hibernate.dialect.Dialect <init>

            INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect

            Jan 10, 2018 5:33:48 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>

            INFO: HHH000397: Using ASTQueryTranslatorFactory

            Jan 10, 2018 5:33:48 PM org.hibernate.search.engine.Version <clinit>

            INFO: HSEARCH000034: Hibernate Search 5.2.0.Final

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute

            INFO: HHH000228: Running hbm2ddl schema update

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute

            INFO: HHH000102: Fetching database metadata

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute

            INFO: HHH000396: Updating schema

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>

            INFO: HHH000261: Table found: csg.course

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>

            INFO: HHH000037: Columns: [syllabus, code, total_credits, name, id, faculty]

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>

            INFO: HHH000108: Foreign keys: []

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.TableMetadata <init>

            INFO: HHH000126: Indexes: [uk_i60mruj0y7a7vs99dqpiye7en, primary]

            Jan 10, 2018 5:33:49 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute

            INFO: HHH000232: Schema update complete

            Jan 10, 2018 5:34:08 PM org.hibernate.search.backend.jgroups.impl.DispatchMessageSender$ManagedChannelContainer start

            INFO: HSEARCH200020: Connected to cluster [ ask-cluster ]. The local Address is CSG-LPTP-37-4765

            Jan 10, 2018 5:34:08 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start

            INFO: ISPN000078: Starting JGroups channel ISPN

            Jan 10, 2018 5:34:39 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted

            INFO: ISPN000094: Received new cluster view for channel ISPN: [CSG-LPTP-37-58496|0] (1) [CSG-LPTP-37-58496]

            Jan 10, 2018 5:34:41 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded

            INFO: ISPN000079: Channel ISPN local address is CSG-LPTP-37-58496, physical addresses are [192.168.1.48:7801]

            Jan 10, 2018 5:34:41 PM org.infinispan.factories.GlobalComponentRegistry start

            INFO: ISPN000128: Infinispan version: Infinispan 'Hoptimus Prime' 7.2.0.Final

            Jan 10, 2018 5:34:42 PM org.infinispan.query.impl.LifecycleManager cacheStarting

            INFO: ISPN014003: Registering Query interceptor

            Jan 10, 2018 5:34:42 PM org.infinispan.query.impl.LifecycleManager cacheStarting

            INFO: ISPN014003: Registering Query interceptor

            Jan 10, 2018 5:34:42 PM org.hibernate.search.engine.impl.ConfigContext getLuceneMatchVersion

            WARN: HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.

            Jan 10, 2018 5:34:42 PM org.hibernate.search.engine.impl.ConfigContext getLuceneMatchVersion

            WARN: HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.

            Jan 10, 2018 5:34:42 PM org.infinispan.expiration.impl.ExpirationManagerImpl start

            INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread

            Jan 10, 2018 5:34:42 PM com.mchange.v2.log.MLog <clinit>

            INFO: MLog clients using java 1.4+ standard logging.

            Jan 10, 2018 5:34:42 PM com.mchange.v2.c3p0.C3P0Registry banner

            INFO: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

            Jan 10, 2018 5:34:42 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager

            INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge14g9s1q51zuc1ywamiq|556728bc, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge14g9s1q51zuc1ywamiq|556728bc, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://192.168.1.52:3306/hsearch, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

            Jan 10, 2018 5:34:42 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager

            INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge14g9s1q51zuc1ywamiq|6095bfe1, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge14g9s1q51zuc1ywamiq|6095bfe1, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://192.168.1.52:3306/hsearch, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

            Jan 10, 2018 5:34:42 PM org.infinispan.factories.TransactionManagerFactory construct

            INFO: ISPN000161: Using a batchMode transaction manager

            Jan 10, 2018 5:34:42 PM org.infinispan.expiration.impl.ExpirationManagerImpl start

            INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread

            Jan 10, 2018 5:34:42 PM org.infinispan.expiration.impl.ExpirationManagerImpl start

            INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread

            Jan 10, 2018 5:34:42 PM org.hibernate.search.engine.impl.ConfigContext getLuceneMatchVersion

            WARN: HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.

            Jan 10, 2018 5:34:42 PM org.hibernate.search.engine.impl.ConfigContext getLuceneMatchVersion

            WARN: HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.

            Jan 10, 2018 5:34:42 PM org.hibernate.search.engine.impl.ConfigContext getLuceneMatchVersion

            WARN: HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.

            Jan 10, 2018 5:34:43 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop

            INFO: HHH000030: Cleaning up connection pool [jdbc:mysql://192.168.1.52:3306/csg]

            Exception in thread "main" javax.persistence.PersistenceException: Unable to build entity manager factory

            at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83)

            at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)

            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)

            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)

            at com.csgsol.TestRig.main(TestRig.java:37)

            Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'Course'

            at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:260)

            at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513)

            at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482)

            at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91)

            at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:358)

            at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:199)

            at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117)

            at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:66)

            at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:52)

            at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:588)

            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)

            at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)

            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)

            at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75)

            ... 4 more

            Caused by: org.hibernate.search.exception.SearchException: Unable to open Lucene IndexReader for IndexManager Course

            at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.createReader(SharingBufferReaderProvider.java:113)

            at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.initialize(SharingBufferReaderProvider.java:91)

            at org.hibernate.search.indexes.impl.PropertiesParseHelper.createDirectoryBasedReaderProvider(PropertiesParseHelper.java:169)

            at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.createIndexReader(DirectoryBasedIndexManager.java:194)

            at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:91)

            at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256)

            ... 19 more

            Caused by: java.io.FileNotFoundException: Error loading metadata for index file: segments_s|M|Course

            at org.infinispan.lucene.impl.DirectoryImplementor.openInput(DirectoryImplementor.java:134)

            at org.infinispan.lucene.impl.DirectoryLuceneV4.openInput(DirectoryLuceneV4.java:101)

            at org.apache.lucene.store.Directory.openChecksumInput(Directory.java:113)

            at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:341)

            at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:57)

            at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:923)

            at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:53)

            at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:67)

            at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.readerFactory(SharingBufferReaderProvider.java:131)

            at org.hibernate.search.indexes.impl.SharingBufferReaderProvider$PerDirectoryLatestReader.<init>(SharingBufferReaderProvider.java:206)

            at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.createReader(SharingBufferReaderProvider.java:108)

            ... 24 more

            • 3. Re: Hibernate-Search, Infinispan (running in multiple instances)
              Gustavo Fernandes Apprentice

              From the logs, I can see Hibernate Search is using Lucene in the filesystem rather than Infinispan. Could you post your latest persistence.xml config?

              • 4. Re: Hibernate-Search, Infinispan (running in multiple instances)
                Nadeem Pasha Newbie

                here is my persistence.xml

                 

                 

                <?xml version="1.0" encoding="UTF-8" ?>
                <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">


                   <persistence-unit name="IC" transaction-type="RESOURCE_LOCAL">

                   <class>com.csgsol.model.Course</class>

                   <properties>

                   <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>

                   <property name="javax.persistence.jdbc.url" value="jdbc:mysql://192.168.1.52:3306/csg"/>

                   <property name="javax.persistence.jdbc.user" value="my-un"/>

                   <property name="javax.persistence.jdbc.password" value="my-pwd"/>

                 

                   <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>

                   <property name="hibernate.hbm2ddl.auto" value="update"/>

                 


                   <property name="hibernate.search.default.directory_provider" value="infinispan"/>

                   <!-- <property name="hibernate.search.default.indexmanager" value="org.infinispan.query.indexmanager.InfinispanIndexManager"/>
                  <property name="hibernate.search.default.indexmanager" value="near-real-time"/>-->
                   <property name="hibernate.search.default.worker.backend" value="jgroups"/>

                   <property name="hibernate.search.services.jgroups.configurationFile" value="csg-jgroupsTcp.xml"/>

                 
                   <property name="hibernate.search.default.exclusive_index_use" value="false"/>

                   <property name="hibernate.search.default.worker.execution" value = "async"/>

                   <property name="hibernate.search.lucene_version" value="LUCENE_4_10_4"/>

                 

                   <property name="hibernate.search.default.worker.thread_pool.size" value = "100"/>

                   <property name="hibernate.search.default.indexwriter.max_buffered_delete_terms" value="-1"/>

                   <property name="hibernate.search.default.indexwriter.max_buffered_docs" value="-1"/>

                   <property name="hibernate.search.default.indexwriter.merge_factor" value="10"/>

                   <property name="hibernate.search.default.indexwriter.merge_min_size" value="1677721"/>

                   <property name="hibernate.search.default.indexwriter.merge_max_size" value="2147483648"/>

                   <property name="hibernate.search.default.indexwriter.merge_max_optimize_size" value="9223372036854775807"/>

                   <property name="hibernate.search.default.indexwriter.merge_calibrate_by_deletes" value="true"/>

                   <property name="hibernate.search.default.indexwriter.max_merge_docs" value="2147483647"/>

                   <property name="hibernate.search.default.indexwriter.ram_buffer_size" value="16.0"/>

                   <property name="hibernate.search.default.indexwriter.term_index_interval" value="128"/>

                   <property name="hibernate.search.default.indexwriter.max_thread_states" value="8"/>

                   <property name="hibernate.search.infinispan.configuration_resourcename" value="my-infinispan.xml"/>

                 

                   </properties>

                   </persistence-unit>

                   </persistence>

                • 5. Re: Hibernate-Search, Infinispan (running in multiple instances)
                  Nadeem Pasha Newbie

                  Hi Gustave,

                   

                  thanks for the reply,

                   

                  can u send me a sample working example with infinispan and jgroup configurations, that has one master, and has jgroup as its backend.

                  • 6. Re: Hibernate-Search, Infinispan (running in multiple instances)
                    Gustavo Fernandes Apprentice

                    My mistake, you are using the Infinispan directory, as this log line show:

                    at org.infinispan.lucene.impl.DirectoryLuceneV4.openInput(DirectoryLuceneV4.java:101)

                     

                    Regarding the worker configuration, I'd recommend not using the "jgroups" worker but the JGroups master/slave backend, where one of you nodes contain jgroupsMaster and the others jgroupsSlave

                    Hibernate Search 5.8.2.Final: Reference Guide

                    • 7. Re: Hibernate-Search, Infinispan (running in multiple instances)
                      Nadeem Pasha Newbie

                      thanks for the reply,

                       

                      Tried with the  JGroups master/slave backend in which one node kept as master and the other one as slave, getting same exception when ran parallely.

                      • 8. Re: Hibernate-Search, Infinispan (running in multiple instances)
                        Gustavo Fernandes Apprentice

                        Could you collect DEBUG logs from org.infinispan, org.jgroups and org.hibernate search packages?

                        • 9. Re: Hibernate-Search, Infinispan (running in multiple instances)
                          Nadeem Pasha Newbie

                          here are the debug logs

                           

                          Exception in thread "Hibernate Search: async deletion of index segments-23" org.infinispan.commons.CacheException: Could not commit implicit transaction

                          at org.infinispan.cache.impl.CacheImpl.tryCommit(CacheImpl.java:1670)

                          at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1624)

                          at org.infinispan.cache.impl.CacheImpl.removeInternal(CacheImpl.java:579)

                          at org.infinispan.cache.impl.CacheImpl.remove(CacheImpl.java:572)

                          at org.infinispan.cache.impl.DecoratedCache.remove(DecoratedCache.java:442)

                          at org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.realFileDelete(DistributedSegmentReadLocker.java:191)

                          at org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.deleteOrReleaseReadLock(DistributedSegmentReadLocker.java:96)

                          at org.infinispan.lucene.impl.DirectoryImplementor.deleteFile(DirectoryImplementor.java:65)

                          at org.infinispan.lucene.impl.DirectoryLuceneV4$DeleteTask.run(DirectoryLuceneV4.java:195)

                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                          at java.lang.Thread.run(Thread.java:745)

                          Caused by: javax.transaction.RollbackException: Transaction marked as rollback only.

                          at org.infinispan.transaction.tm.DummyTransaction.setRollbackOnly(DummyTransaction.java:148)

                          at org.infinispan.interceptors.InvocationContextInterceptor.markTxForRollbackAndRethrow(InvocationContextInterceptor.java:163)

                          at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)

                          at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:66)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)

                          at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:121)

                          at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:104)

                          at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:44)

                          at org.infinispan.transaction.tm.DummyTransaction.notifyBeforeCompletion(DummyTransaction.java:438)

                          at org.infinispan.transaction.tm.DummyTransaction.runPrepare(DummyTransaction.java:254)

                          at org.infinispan.transaction.tm.DummyTransaction.commit(DummyTransaction.java:103)

                          at org.infinispan.transaction.tm.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:73)

                          at org.infinispan.cache.impl.CacheImpl.tryCommit(CacheImpl.java:1667)

                          ... 11 more

                          Jan 12, 2018 4:16:11 PM org.infinispan.transaction.tm.DummyTransaction notifyBeforeCompletion

                          ERROR: ISPN000109: beforeCompletion() failed for SynchronizationAdapter{localTransaction=LocalTransaction{remoteLockedNodes=null, isMarkedForRollback=false, lockedKeys=null, backupKeyLocks=null, topologyId=8, stateTransferFlag=null} org.infinispan.transaction.synchronization.SyncLocalTransaction@355} org.infinispan.transaction.synchronization.SynchronizationAdapter@374

                          org.infinispan.commons.CacheException: Could not prepare.

                          at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:46)

                          at org.infinispan.transaction.tm.DummyTransaction.notifyBeforeCompletion(DummyTransaction.java:438)

                          at org.infinispan.transaction.tm.DummyTransaction.runPrepare(DummyTransaction.java:254)

                          at org.infinispan.transaction.tm.DummyTransaction.commit(DummyTransaction.java:103)

                          at org.infinispan.transaction.tm.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:73)

                          at org.infinispan.cache.impl.CacheImpl.tryCommit(CacheImpl.java:1667)

                          at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1624)

                          at org.infinispan.cache.impl.CacheImpl.removeInternal(CacheImpl.java:579)

                          at org.infinispan.cache.impl.CacheImpl.remove(CacheImpl.java:572)

                          at org.infinispan.cache.impl.DecoratedCache.remove(DecoratedCache.java:442)

                          at org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.realFileDelete(DistributedSegmentReadLocker.java:191)

                          at org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.deleteOrReleaseReadLock(DistributedSegmentReadLocker.java:96)

                          at org.infinispan.lucene.impl.DirectoryImplementor.deleteFile(DirectoryImplementor.java:65)

                          at org.infinispan.lucene.impl.DirectoryLuceneV4$DeleteTask.run(DirectoryLuceneV4.java:195)

                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                          at java.lang.Thread.run(Thread.java:745)

                          Caused by: javax.transaction.xa.XAException

                          at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:141)

                          at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:104)

                          at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:44)

                          ... 16 more

                          Caused by: org.infinispan.transaction.WriteSkewException: Write skew detected on key segments_o|M|Course for transaction DummyTransaction{xid=DummyXid{id=853}, status=0}

                          at org.infinispan.transaction.impl.WriteSkewHelper.performWriteSkewCheckAndReturnNewVersions(WriteSkewHelper.java:59)

                          at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.clusteredCreateNewVersionsAndCheckForWriteSkews(ClusteringDependentLogic.java:178)

                          at org.infinispan.interceptors.locking.ClusteringDependentLogic$AbstractClusteringDependentLogic.createNewVersionsAndCheckForWriteSkews(ClusteringDependentLogic.java:97)

                          at org.infinispan.interceptors.VersionedEntryWrappingInterceptor.visitPrepareCommand(VersionedEntryWrappingInterceptor.java:49)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.query.backend.QueryInterceptor.visitPrepareCommand(QueryInterceptor.java:327)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.invokeNextAndCommitIf1Pc(AbstractTxLockingInterceptor.java:96)

                          at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:91)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:36)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:138)

                          at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:125)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitPrepareCommand(TransactionSynchronizerInterceptor.java:42)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:207)

                          at org.infinispan.statetransfer.StateTransferInterceptor.visitPrepareCommand(StateTransferInterceptor.java:95)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:111)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:102)

                          at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:71)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:97)

                          at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:66)

                          at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:123)

                          at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:123)

                          at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)

                          at org.infinispan.transaction.impl.TransactionCoordinator.prepare(TransactionCoordinator.java:121)

                          ... 18 more

                          • 10. Re: Hibernate-Search, Infinispan (running in multiple instances)
                            Gustavo Fernandes Apprentice

                            Those are not DEBUG logs, can't see any DEBUG statement? You need to change you Log4J (or equivalent) to add DEBUG to the packages I mentioned earlier.

                            What I'd like to check, specifically, is whether the JGroups backend elected a leader, if the Infinispan cluster formed correctly, and if the indexing works are being

                            forwarded to the master node.

                             

                            EDIT: Also, is there any reason why you are using a very old Hibernate Search and Infinispan versions (5.2.0 and 7.2.0)? I'd suggested trying with latest ones, as they are

                            maintained

                             

                            Thanks,

                            Gustavo

                            • 11. Re: Hibernate-Search, Infinispan (running in multiple instances)
                              Gourav Singh Newbie

                              Hi Nadeem,

                               

                              I am trying to use the same. But, I am tgeting following exception:

                               

                              Caused by: org.hibernate.search.SearchException: Could not start Infinispan CacheManager using as configuration file: infinispan.xml

                              at org.hibernate.search.infinispan.CacheManagerServiceProvider.start(CacheManagerServiceProvider.java:101)

                              at org.hibernate.search.engine.impl.StandardServiceManager$ServiceProviderWrapper.startVirtual(StandardServiceManager.java:181)

                              at org.hibernate.search.engine.impl.StandardServiceManager.requestService(StandardServiceManager.java:125)

                              at org.hibernate.search.infinispan.impl.InfinispanDirectoryProvider.initialize(InfinispanDirectoryProvider.java:97)

                              at org.hibernate.search.store.impl.DirectoryProviderFactory.createDirectoryProvider(DirectoryProviderFactory.java:88)

                              ... 74 more

                              Caused by: java.io.FileNotFoundException: infinispan.xml

                              at org.hibernate.search.infinispan.impl.InfinispanConfigurationParser.parseFile(InfinispanConfigurationParser.java:75)

                              at org.hibernate.search.infinispan.CacheManagerServiceProvider.start(CacheManagerServiceProvider.java:96)

                              ... 78 more

                               

                              My configuration is as follows:

                               

                              <prop key="hibernate.search.default.directory_provider">infinispan</prop>

                              <prop key="hibernate.search.infinispan.configuration_resourcename">infinispan.xml</prop>

                               

                              infinispan.xml file is present in classpath. But, still its not being loaded. Can you help me out?