title: Hibernate Search- Index not created
body: <p>i am currently writing my final dissertation in university with the topic of integrating search functionalities into an existing web application and want to use Hibernate Search.</p>
  
  <p>But i am struggling with the indexing of entities in the already existing application.
  It seems like the indexing is not working, because no index files are generated when i create a new entity. Also, the base index directory configured in the hibernate configuration is not created when i start the application. 
  The application uses the Spring Framework and Hibernate Core with hibernate-jpa 2.0 (see pom.xml).</p>
  
  <p>I get no errors when executing the application, but there is an info concerning Hibernate Search</p>
  
  <pre><code> INFO AnnotationSessionFactoryBean:780 - Building new Hibernate SessionFactory
   INFO HibernateSearchEventListenerRegister:75 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
  </code></pre>
  
  <p>I read that i don´t need to integrate these listeners when using hibernate annotations, so this can´t be the source of the problem, right? </p>
  
  <p><strong>Extract from pom.xml</strong></p>
  
  <pre><code>    &lt;dependencies&gt;
         ...
        &lt;dependency&gt;
           &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
           &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
           &lt;version&gt;${hibernate.version}&lt;/version&gt;
        &lt;/dependency&gt;
  
        &lt;dependency&gt;
           &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
           &lt;artifactId&gt;hibernate-envers&lt;/artifactId&gt;
           &lt;version&gt;${hibernate.version}&lt;/version&gt;
        &lt;/dependency&gt;
  
        &lt;dependency&gt;
           &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
           &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
           &lt;version&gt;${hibernate-validator.version}&lt;/version&gt;
        &lt;/dependency&gt;
  
        &lt;dependency&gt;
           &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
           &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
           &lt;version&gt;1.0.1.Final&lt;/version&gt;
        &lt;/dependency&gt;
  
        &lt;dependency&gt;
           &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
           &lt;artifactId&gt;hibernate-search-orm&lt;/artifactId&gt;
           &lt;version&gt;4.3.0.Final&lt;/version&gt;
        &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p><strong>Extract from applicationContext.xml</strong></p>
  
  <pre><code>&lt;!-- Configuration of Hibernate Session --&gt;
     &lt;bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
  
        &lt;property name="dataSource" ref="dataSource" /&gt;
        &lt;property name="packagesToScan" value="de.user.server.model" /&gt;
        &lt;property name="hibernateProperties"&gt;
           &lt;props&gt;
              &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;${jdbc.debug}&lt;/prop&gt;
              &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.id.new_generator_mappings"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.dialect"&gt;${jdbc.dialect}&lt;/prop&gt;
              &lt;prop key="hibernate.jdbc.batch_size"&gt;0&lt;/prop&gt;
              &lt;prop key="hibernate.hbm2ddl.import_files"&gt;import.sql&lt;/prop&gt;
              &lt;prop key="hibernate.c3p0.idle_test_period"&gt;28680&lt;/prop&gt;
              &lt;prop key="hibernate.search.default.directory_provider"&gt;filesystem&lt;/prop&gt;
              &lt;prop key="hibernate.search.default.indexBase"&gt;H:/indexes&lt;/prop&gt;
  
           &lt;/props&gt;
        &lt;/property&gt;
  
  &lt;!-- hibernate-envers for versioning of entities --&gt;
        &lt;property name="eventListeners"&gt;
           &lt;map&gt;
              &lt;entry key="post-insert" value-ref="envers" /&gt;
              &lt;entry key="post-update" value-ref="envers" /&gt;
              &lt;entry key="post-delete" value-ref="envers" /&gt;
              &lt;entry key="pre-collection-update" value-ref="envers" /&gt;
              &lt;entry key="pre-collection-remove" value-ref="envers" /&gt;
              &lt;entry key="post-collection-recreate" value-ref="envers" /&gt;
           &lt;/map&gt;
        &lt;/property&gt;
     &lt;/bean&gt;
  </code></pre>
  
  <p><strong>Text.java</strong></p>
  
  <pre><code>@Entity
  @Indexed
  @Connectable(modelClass = ModelClassEnum.TEXT)
  public class Text extends AbstractDataObject {
  
      /**
       * Value generated automatically by eclipse.
       */
      private static final long serialVersionUID = 8096234710520978913L;
  
      private String text;
  
      public Text() {
  
      }    
  
      @Lob
      @Field (name="text",index=Index.YES, analyze=Analyze.YES,store=Store.YES)
      public String getText() {
          return this.text;
      }
  
  public void setText(String text) {
          this.text = text;       
      }
  }
  </code></pre>
  
  <p><strong>AbstractDataObject.java</strong></p>
  
  <pre><code>@Entity
  @Audited
  @Inheritance(strategy = InheritanceType.JOINED)
  public class AbstractDataObject extends BaseDomainModel {
      private Long objectId;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @DocumentId
      public Long getObjectId() {
       return objectId;
      }
  }
  </code></pre>
  
  <p>I am looking forward to your answers.</p>
  
  <p>Kind regards,
  hbsnovice</p>