title: org.hibernate.impl.SessionImpl cannot be cast to org.hibernate.engine.spi.SessionImplementor While using Full Text Search
body: <p>I am using hibernate-search-4.5.2.Final to implement a full text search but getting an exception with following message</p>
  
  <blockquote>
    <p>org.hibernate.impl.SessionImpl cannot be cast to org.hibernate.engine.spi.SessionImplementor</p>
  </blockquote>
  
  <p>in the following line</p>
  
  <pre><code>FullTextSession fullTextSession = Search.getFullTextSession(sessionImpl.getFactory().openSession());
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>    @Autowired  
  private SessionFactory sessionFactory;
  @SuppressWarnings("rawtypes")
  @Override
  public List getFuzzySearchedResult(String query_string) {
      try {
          Session session = sessionFactory.openSession();
          FullTextSession fullTextSession = Search.getFullTextSession(session);
          final QueryBuilder mythQB = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(FaqMaster.class).get();
          org.apache.lucene.search.Query luceneQuery = mythQB.phrase().withSlop(3).onField("question_name").andField("qustion_answer").sentence("Department").createQuery();
  
          org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery);
          List result = fullTextQuery.list();
          return result;
      }
      catch(Exception e){System.out.println("ERROR: "); e.printStackTrace(); return null;}
  }
  </code></pre>
  
  <p>Please help.</p>