title: Object is not an indexed entity or a subclass of an indexed entity
body: <p>I am doing some web app with hibernate, hibernate search, lucene and tapestry. Now, everything is OK, until I have deployed this part of code into my app. I keep getting this error</p>
  
  <pre><code>Render queue error in SetupRender[Index:layout.listarticles.grid]: Failure reading parameter 'source' of component Index:layout.listarticles.grid: java.lang.Object is not an indexed entity or a subclass of an indexed entity
  </code></pre>
  
  <p>even though I have denoted my Article class with @Indexed annotation as specified. What may cause this issue? May my inherited classes cause this issue, since my Article is a top of many other subclasses, and HS or Lucene can't provide polymorhic search or what? I am stuck on this for half an hour now. Any help is appreciated. Thanks in advance.</p>
  
  <pre><code>public class ListArticles {
  
  
      @Property
      @SuppressWarnings("unused")
      private Article article;
      @Inject
      private Session hibernate;
      @SessionState // changed from ApplicationState
      @Property
      private User user;
      @Property
      private boolean ifUserExists;
  
      private static Logger logger = Logger.getLogger(ListArticles.class);
      @Inject
      private HibernateSessionManager hibernateSessionManager;
      @Property
      @Persist(PersistenceConstants.FLASH)
      private String searchText;
  
      /**
       * 
       *
       * @return list
       */
      @CommitAfter
      @SuppressWarnings("unchecked")
      public List&lt;Article&gt; getArticles() {
  
          if (article != null) {
  
              return hibernate.createCriteria(Article.class).list();
          } else if (searchText != null &amp;&amp; searchText.trim().length() &gt; 0) {
              FullTextSession fullTextSession = Search.getFullTextSession(hibernateSessionManager.getSession());
              try {
                  fullTextSession.createIndexer().startAndWait();
              } catch (java.lang.InterruptedException e) {
                  logger.warn("Lucene Indexing was interrupted by something " + e);
              }
  
              QueryBuilder qb = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(Article.class).get();
              org.apache.lucene.search.Query luceneQuery = qb
                      .keyword()
                      .onFields("name, desc")
                      .matching(searchText)
                      .createQuery();
  
              return fullTextSession.createFullTextQuery(luceneQuery, Article.class).list();
          } else {
              // default - unfiltered - all entitites list 
              return hibernate.createCriteria(Article.class).list();
  
          }
      }
       // 1520 lines of code trimmed using Built-in plugin CodeTrimmer
  </code></pre>
  
  <p>My ListArticles.tml file looks like following    </p>
  
  <pre><code>&lt;PostDisplay xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter"&gt;
          &lt;p&gt;${message:newestArticles}&lt;/p&gt;
           &lt;form t:type="Form" t:id="searchForm"&gt;
                  &lt;input t:type="TextField" t:id="searchText" size="30" value="searchText" /&gt;    
                  &lt;t:submit t:id="search" value="Search" /&gt;&lt;t:submit t:id="clear" value="Clear/Show All" /&gt;  
  
              &lt;/form&gt;
          &lt;t:grid source="articles" row="article" include="name, desc" &gt;
          &lt;p:nameCell&gt;${article.name}&lt;/p:nameCell&gt;
          &lt;p:descriptionCell&gt;${article.desc}&lt;/p:descriptionCell&gt;
           &lt;p:empty&gt;
             &lt;p&gt;No articles could be found!&lt;/p&gt;
           &lt;/p:empty&gt;
        &lt;/t:grid&gt;
      &lt;/PostDisplay&gt;
  </code></pre>
  
  <p>And my Article.java class looks like</p>
  
  <pre><code>    @Entity
      @Table(name="Article")
      @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
      @DiscriminatorColumn(name="ART_TYPE",discriminatorType = DiscriminatorType.STRING)
      @Indexed(index="indexes/essays")
      public abstract class Article
      {
      @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
      @Basic(optional = false)
      @Column(name = "ART_ID")
      @DocumentId
      private Long id;
  
      @Basic(optional = false)
      @Column(name = "ART_NAME")
      @Field
      private String name;
  
  
      @Basic(optional = true)
      @Column(name = "ART_DESC")
      @Field
      private String desc;
  
      @Basic(optional = true)
      @Column(name = "ART_IMAGE")
      @Field
      private String image;
  
      @Basic(optional = true)
      @Column(name = "ART_TYPE")
      @Field
      private String articleType; // hard-coded, make it more pro
  
      @Basic(optional = true)
      @Column(name = "ART_SUBTYPE")
      @Field
      private String articleSubType; // hard-coded, make it more pro
  
      //to change or not to change this ...
      @OneToMany(mappedBy = "article", cascade={CascadeType.ALL})
      private Collection&lt;Picture&gt; collectionOfPictures;
  
  
      @OneToMany(mappedBy = "article")
      private Collection&lt;StarRates&gt; collectionOfStarRates;  
  
      //148 lines of code trimmed using Built-in plugin CodeTrimmer
  </code></pre>