Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>NOTE: I started with a clean JBoss 7.1.1 instance and hence reverted from Infinispan 5.1.6 to 5.1.2</p> <p>For my needs I modified the existing cluster cache so it looks like this </p> <pre><code>&lt;cache-container name="cluster" aliases="ha-partition" default-cache="default" start="EAGER"&gt; &lt;transport lock-timeout="60000" /&gt; &lt;replicated-cache name="default" mode="SYNC" batching="true" indexing="LOCAL"&gt; &lt;locking isolation="REPEATABLE_READ" /&gt; &lt;store class="org.infinispan.loaders.file.FileCacheStore" preload="true" passivation="false" fetch-state="true" purge="false"&gt; &lt;property name="location"&gt; /tempCacheIndex &lt;/property&gt; &lt;/store&gt; &lt;/replicated-cache&gt; </code></pre> <p></p> <p>Then to actually be able to query the cache create the org.infinispan.query module containing the jars mentioned in the following module.xml </p> <pre><code>&lt;module xmlns="urn:jboss:module:1.1" name="org.infinispan.query"&gt; &lt;resources&gt; &lt;resource-root path="avro-1.5.1.jar"/&gt; &lt;resource-root path="hibernate-commons-annotations-4.0.1.Final.jar"/&gt; &lt;resource-root path="hibernate-search-4.1.0.Beta1.jar"/&gt; &lt;resource-root path="hibernate-search-analyzers-4.1.0.Beta1.jar"/&gt; &lt;resource-root path="hibernate-search-engine-4.1.0.Beta1.jar"/&gt; &lt;resource-root path="hibernate-search-orm-4.1.0.Beta1.jar"/&gt; &lt;resource-root path="infinispan-query.jar"/&gt; &lt;resource-root path="jackson-core-asl-1.9.2.jar"/&gt; &lt;resource-root path="jackson-mapper-asl-1.9.2.jar"/&gt; &lt;resource-root path="lucene-analyzers-3.5.0.jar"/&gt; &lt;resource-root path="lucene-core-3.5.0.jar"/&gt; &lt;resource-root path="lucene-grouping-3.5.0.jar"/&gt; &lt;resource-root path="lucene-highlighter-3.5.0.jar"/&gt; &lt;resource-root path="lucene-memory-3.5.0.jar"/&gt; &lt;resource-root path="lucene-misc-3.5.0.jar"/&gt; &lt;resource-root path="lucene-smartcn-3.5.0.jar"/&gt; &lt;resource-root path="lucene-spatial-3.5.0.jar"/&gt; &lt;resource-root path="lucene-spellchecker-3.5.0.jar"/&gt; &lt;resource-root path="lucene-stempel-3.5.0.jar"/&gt; &lt;resource-root path="paranamer-2.3.jar"/&gt; &lt;resource-root path="slf4j-api-1.6.1.jar"/&gt; &lt;resource-root path="snappy-java-1.0.4.1.jar"/&gt; &lt;resource-root path="solr-analysis-extras-3.5.0.jar"/&gt; &lt;resource-root path="solr-commons-csv-3.5.0.jar"/&gt; &lt;resource-root path="solr-core-3.5.0.jar"/&gt; &lt;resource-root path="solr-solrj-3.5.0.jar"/&gt; &lt;/resources&gt; &lt;dependencies&gt; &lt;module name="javax.api"/&gt; &lt;module name="javax.transaction.api"/&gt; &lt;module name="org.hibernate"/&gt; &lt;module name="org.infinispan" services="import" export="true"/&gt; &lt;module name="org.apache.commons.codec"/&gt; &lt;module name="org.apache.commons.io"/&gt; &lt;module name="org.apache.commons.lang"/&gt; &lt;module name="com.google.guava"/&gt; &lt;module name="org.slf4j" export="true"/&gt; &lt;module name="org.jboss.logging"/&gt; &lt;/dependencies&gt; </code></pre> <p></p> <p>Modify the <code>org.jboss.as.clustering.infinspan</code> module xml to include a dependency on the new query module but also the <code>org.hibernate</code> module that already exists. So add the following to that file.</p> <pre><code>&lt;module name="org.hibernate" services="import"/&gt; &lt;module name="org.infinispan.query" services="import"/&gt; </code></pre> <p>The jboss-deployment-structure.xml of your app needs to have the following dependencies added to it </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;jboss-deployment-structure&gt; &lt;deployment&gt; &lt;dependencies&gt; &lt;module export="true" name="org.hibernate" services="import"/&gt; &lt;module export="true" name="org.infinispan" services="import"/&gt; &lt;module export="true" name="org.infinispan.query" services="import"/&gt; &lt;/dependencies&gt; &lt;/deployment&gt; &lt;/jboss-deployment-structure&gt; </code></pre> <p>For annotating your objects so they can be indexed and searched I suggest you look at the samples <a href="https://docs.jboss.org/author/display/ISPN51/Querying+Infinispan" rel="nofollow">here</a></p> <p>EDIT: FURTHER NOTE: To get indexed objects to actually share over the cache I now had to </p> <ul> <li>Create a jar containing all the classes that you plan to put in the cache.</li> <li>Make sure these entities do not contain anything too complex it terms of imports or you'll run into class loader issues.</li> <li>Create a module from this jar, and give it a dependency on the Infinispan.query module.</li> <li>Expose this module as a global module (is this actually needed?) in the standalone.xml or domain.xml whichever is appropriate.</li> <li>Find the file modules/org/jboss/as/clustering/infinispan/main/module.xml</li> <li>Add your new module containing your cachable entities to the list of dependencies</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload