0 Replies Latest reply on Oct 3, 2012 4:31 PM by Van Halbert

    Unable to convert embedded configuration into JBoss AS 7.1.1 container configuration

    Van Halbert Master

      I was able to create local cache using an infinispan configuration file, which turns on indexing, but unable to create a cache in AS 7.   I keep getting:

       

      14:39:42,824 ERROR [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue3) Connector worker process failed for atomic-request=OiLwnHuqNH+P.1.3.0: java.lang.IllegalArgumentException: HSEARCH000109: org.jboss.teiid.quickstart.infinispancache.pojo.Order is not an indexed type

          at org.hibernate.search.impl.ImmutableSearchFactory.getSafeIndexBindingForEntity(ImmutableSearchFactory.java:344)

          at org.hibernate.search.impl.ImmutableSearchFactory.getAnalyzer(ImmutableSearchFactory.java:246)

          at org.hibernate.search.query.dsl.impl.ConnectedQueryContextBuilder$HSearchEntityContext.<init>(ConnectedQueryContextBuilder.java:55)

          at org.hibernate.search.query.dsl.impl.ConnectedQueryContextBuilder.forEntity(ConnectedQueryContextBuilder.java:46)

          at org.infinispan.query.SearchManagerImpl.buildQueryBuilderForClass(SearchManagerImpl.java:95)

       

       

      In AS 7:

       

              <cache-container name="local-quickstart" default-cache="local-quickstart-cache" jndi-name="java:jboss/infinispan/container/local-quickstart">
                    <local-cache name="local-quickstart-cache" start="EAGER" indexing="LOCAL">
                            <eviction strategy="LRU" max-entries="10000"/>
                           <expiration max-idle="108000000"/>
                      </local-cache>

      </cache-container>

       

       

      Config file that worked:

       

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

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

                  xmlns="urn:infinispan:config:5.0">

        <global />

        <default>

          <loaders shared="false" preload="true">

            <loader class="org.infinispan.loaders.file.FileCacheStore"

                    fetchPersistentState="false"

                    ignoreModifications="false"

                    purgeOnStartup="false">

              <properties>

                <property name="location" value="target/localcache"/>

              </properties>

            </loader>

          </loaders>

            <indexing enabled="true" indexLocalOnly="true">

                <properties>

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

                </properties>

            </indexing>

        </default>

          <namedCache name="local-quickstart">

              <loaders shared="false" preload="true">

                  <loader class="org.infinispan.loaders.file.FileCacheStore"

                      fetchPersistentState="true"

                      ignoreModifications="false"

                      purgeOnStartup="false">

                      <properties>

                          <property name="location" value="./target/localcache/indexing/trades"/>

                      </properties>

                  </loader>

              </loaders>

          </namedCache>

      </infinispan>

       

      I have verified (and reverified) that my class is defined as follows:

       

      @Entity

      @Indexed(index = "Order" )

      public class Order implements java.io.Serializable {

      ...

      @Id

        @DocumentId

          public int getId() {

              return this.id;

          }

         

          @Field @DateBridge(resolution=Resolution.MINUTE)

          public Date getOrderDate() {

              return  this.orderDate;

          }

       

          @Field(index=Index.YES)

          public String getPerson() {

              return this.person;

          }

       

      ....

       

       

      The class has no @IndexedEmbedded fields.

       

      Any ideas?