2 Replies Latest reply on Apr 2, 2013 9:31 AM by satyakishor.m

    Issues with modeshape JCR search in transactional mode

    satyakishor.m

      I am trying to insert nodes into repository as batch within an EJB transaction. Nodes are getting created successfully but for some reason search is not returing any nodes. I see the following warning messages in the server log when inserting nodes into repo.

       

      14:15:54,452 WARN  [com.arjuna.ats.jta] (EJB default - 2) ARJUNA016029: SynchronizationImple.afterCompletion - failed for org.modeshape.jcr.txn.SynchronizedTransactions$SynchronizedTransaction$1@1ea872 with exception: java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: 0:ffff0a0cdc39:392918e1:5159cda2:815 status: ActionStatus.COMMITTED > is not in a valid state to be invoking cache operations on.
                at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:230) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:194) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:188) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:184) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:93) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:130) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:89) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.CacheImpl.get(CacheImpl.java:272) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.CacheImpl.get(CacheImpl.java:264) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.infinispan.AbstractDelegatingCache.get(AbstractDelegatingCache.java:255) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]
                at org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore.getExtractedText(InfinispanBinaryStore.java:475) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.value.binary.AbstractBinaryStore.getText(AbstractBinaryStore.java:113) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.addDynamicField(BasicLuceneSchema.java:268) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.nodeInfo(BasicLuceneSchema.java:202) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.updateIndex(BasicLuceneSchema.java:412) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.JcrRepository$RepositoryMonitorFactory$3.recordUpdate(JcrRepository.java:1867) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.txn.SynchronizedTransactions$UpdateCall.send(SynchronizedTransactions.java:317) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.txn.SynchronizedTransactions$AccumulatingMonitor.forward(SynchronizedTransactions.java:255) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.txn.SynchronizedTransactions$SynchronizedTransaction.afterCommit(SynchronizedTransactions.java:165) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at org.modeshape.jcr.txn.SynchronizedTransactions$SynchronizedTransaction$1.afterCompletion(SynchronizedTransactions.java:120) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final]
                at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:96)
                at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:402)
                at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:103)
                at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
                at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
                at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
                at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
                at org.jboss.as.ejb3.component.interceptors.AsyncFutureInterceptorFactory$1$1.runInvocation(AsyncFutureInterceptorFactory.java:71) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.as.ejb3.component.interceptors.AsyncInvocationTask.run(AsyncInvocationTask.java:73) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07]
                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
                at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      
      

       

       

      Is the above warnings are the reason that the indexes are not building properly or Is there any reason for my search not to work properly????

       

      BTW, when I rebuild the indexes using the following statement, search returns the correct nodes.

       

      ((org.modeshape.jcr.api.Workspace)session.getWorkspace()).reindexAsync("/");

        • 1. Re: Issues with modeshape JCR search in transactional mode
          hchiorean

          Looking at the stack trace, the exception seems to be coming from the InfinispanBinaryStore which is configured to store binaries (binary properties)

           

          Any chance you can post your configurations ?

          • 2. Re: Issues with modeshape JCR search in transactional mode
            satyakishor.m

            Please find below the configurations that I was using.

             

            <cache-container name="modeshape">

                      <local-cache name="BINARY_DATA">

                                <transaction mode="FULL_XA"/>

                                <eviction strategy="LIRS" max-entries="10000"/>

                                <store class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" passivation="false" fetch-state="false" purge="false">

                                          <write-behind flush-lock-timeout="1000" thread-pool-size="1"/>

                                          <property name="stringsTableNamePrefix">

                                                    UJ.JERMS

                                          </property>

                                          <property name="idColumnName">

                                                    ID

                                          </property>

                                          <property name="dataColumnName">

                                                    DATA_X

                                          </property>

                                          <property name="timestampColumnName">

                                                    CREATE_TS

                                          </property>

                                          <property name="timestampColumnType">

                                                    BIGINT

                                          </property>

                                          <property name="connectionFactoryClass">

                                                    org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory

                                          </property>

                                          <property name="datasourceJndiLocation">

                                                    java:jboss/jdbc/jpod

                                          </property>

                                          <property name="idColumnType">

                                                    VARCHAR(254)

                                          </property>

                                          <property name="dataColumnType">

                                                    BLOB(1 M)

                                          </property>

                                          <property name="dropTableOnExit">

                                                    false

                                          </property>

                                          <property name="createTableOnStart">

                                                    false

                                          </property>

                                </store>

                      </local-cache>

                      <local-cache name="BINARY_METADATA">

                                <transaction mode="FULL_XA"/>

                                <eviction strategy="LIRS" max-entries="10000"/>

                                <store class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" passivation="false" fetch-state="false" purge="false">

                                          <write-behind flush-lock-timeout="1000" thread-pool-size="1"/>

                                          <property name="stringsTableNamePrefix">

                                                    UJ.JERMS

                                          </property>

                                          <property name="idColumnName">

                                                    ID

                                          </property>

                                          <property name="dataColumnName">

                                                    DATA_X

                                          </property>

                                          <property name="timestampColumnName">

                                                    CREATE_TS

                                          </property>

                                          <property name="timestampColumnType">

                                                    BIGINT

                                          </property>

                                          <property name="connectionFactoryClass">

                                                    org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory

                                          </property>

                                          <property name="datasourceJndiLocation">

                                                    java:jboss/jdbc/jpod

                                          </property>

                                          <property name="idColumnType">

                                                    VARCHAR(254)

                                          </property>

                                          <property name="dataColumnType">

                                                    BLOB(1 M)

                                          </property>

                                          <property name="dropTableOnExit">

                                                    false

                                          </property>

                                          <property name="createTableOnStart">

                                                    false

                                          </property>

                                </store>

                      </local-cache>

                      <local-cache name="CONTENT">

                                <transaction mode="FULL_XA"/>

                                <eviction strategy="LIRS" max-entries="10000"/>

                                <store class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" passivation="false" fetch-state="false" purge="false">

                                          <write-behind flush-lock-timeout="1000" thread-pool-size="15"/>

                                          <property name="stringsTableNamePrefix">

                                                    UJ.JERMS

                                          </property>

                                          <property name="idColumnName">

                                                    ID

                                          </property>

                                          <property name="dataColumnName">

                                                    DATA_X

                                          </property>

                                          <property name="timestampColumnName">

                                                    CREATE_TS

                                          </property>

                                          <property name="timestampColumnType">

                                                    BIGINT

                                          </property>

                                          <property name="connectionFactoryClass">

                                                    org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory

                                          </property>

                                          <property name="datasourceJndiLocation">

                                                    java:jboss/jdbc/jpod

                                          </property>

                                          <property name="idColumnType">

                                                    VARCHAR(254)

                                          </property>

                                          <property name="dataColumnType">

                                                    BLOB(1 M)

                                          </property>

                                          <property name="dropTableOnExit">

                                                    false

                                          </property>

                                          <property name="createTableOnStart">

                                                    false

                                          </property>

                                </store>

                      </local-cache>

            </cache-container>

            <cache-container name="modeshape-index" start="EAGER">

                      <local-cache name="INDEX_DATA" batching="true">

                                <transaction mode="NONE"/>

                                <eviction strategy="LIRS" max-entries="10000"/>

                                <store class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" passivation="false" fetch-state="false" purge="false">

                                          <write-behind flush-lock-timeout="1000" thread-pool-size="1"/>

                                          <property name="key2StringMapperClass">

                                                    org.infinispan.lucene.LuceneKey2StringMapper

                                          </property>

                                          <property name="stringsTableNamePrefix">

                                                    UJ.JERMS

                                          </property>

                                          <property name="idColumnName">

                                                    ID

                                          </property>

                                          <property name="dataColumnName">

                                                    DATA_X

                                          </property>

                                          <property name="timestampColumnName">

                                                    CREATE_TS

                                          </property>

                                          <property name="timestampColumnType">

                                                    BIGINT

                                          </property>

                                          <property name="connectionFactoryClass">

                                                    org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory

                                          </property>

                                          <property name="datasourceJndiLocation">

                                                    java:jboss/jdbc/jpod

                                          </property>

                                          <property name="idColumnType">

                                                    VARCHAR(254)

                                          </property>

                                          <property name="dataColumnType">

                                                    BLOB(1M)

                                          </property>

                                          <property name="dropTableOnExit">

                                                    false

                                          </property>

                                          <property name="createTableOnStart">

                                                    false

                                          </property>

                                </store>

                      </local-cache>

                      <local-cache name="INDEX_METADATA" batching="true">

                                <transaction mode="NONE"/>

                                <eviction strategy="LIRS" max-entries="10000"/>

                                <store class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" passivation="false" fetch-state="false" purge="false">

                                          <write-behind flush-lock-timeout="1000" thread-pool-size="1"/>

                                          <property name="key2StringMapperClass">

                                                    org.infinispan.lucene.LuceneKey2StringMapper

                                          </property>

                                          <property name="stringsTableNamePrefix">

                                                    UJ.JERMS

                                          </property>

                                          <property name="idColumnName">

                                                    ID

                                          </property>

                                          <property name="dataColumnName">

                                                    DATA_X

                                          </property>

                                          <property name="timestampColumnName">

                                                    CREATE_TS

                                          </property>

                                          <property name="timestampColumnType">

                                                    BIGINT

                                          </property>

                                          <property name="connectionFactoryClass">

                                                    org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory

                                          </property>

                                          <property name="datasourceJndiLocation">

                                                    java:jboss/jdbc/jpod

                                          </property>

                                          <property name="idColumnType">

                                                    VARCHAR(254)

                                          </property>

                                          <property name="dataColumnType">

                                                    BLOB(1M)

                                          </property>

                                          <property name="dropTableOnExit">

                                                    false

                                          </property>

                                          <property name="createTableOnStart">

                                                    false

                                          </property>

                                </store>

                      </local-cache>

            </cache-container>

             

            <repository name="jerms" cache-name="CONTENT" cache-container="modeshape" enable-monitoring="false">

                            <cache-index-storage data-cache-name="INDEX_DATA" metadata-cache-name="INDEX_METADATA" cache-container="modeshape-index"/>

                            <cache-binary-storage data-cache-name="BINARY_DATA" metadata-cache-name="BINARY_METADATA" cache-container="modeshape"/>

                            <text-extractors>

                                <text-extractor name="tika-extractor" classname="tika" module="org.modeshape.extractor.tika"/>

                            </text-extractors>

            </repository>