title: Hibernate search - The SearchFactory was not initialized using command prompt
body: <p>I am using hibernate search 5.9.3.<br/>My code is getting executed and indexes are being created perfectly while running the code using eclipse.<br/> But when I am running .jar file using command prompt, it is giving following exception. <a href="https://i.stack.imgur.com/FyagY.png%3Cbr/%3E" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FyagY.png%3Cbr/%3E" alt="enter image description here" /></a></p>
  <p><br/> My code snippet is as follows:<br/></p>
  <pre><code>factory = configuration.buildSessionFactory(serviceRegistry);
      Session session = factory.openSession();
      try {
          Thread.sleep(10);
      } catch (InterruptedException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
      }
      SwingUtilities.invokeLater(new Runnable() {
  
          @Override
          public void run() {
              System.out.println(&quot;1:Search.getFullTextEntityManager(factory.openSession())&quot;);
              fullTextEntityManager = Search.getFullTextEntityManager(session);
              session.getTransaction().begin();
              try {
                  Thread.sleep(20);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
  
              System.out.println(&quot;2:fullTextEntityManager.createIndexer().startAndWait();&quot;);
              try {
                  fullTextEntityManager.createIndexer().startAndWait();
              } catch (InterruptedException ex) {
                  ex.printStackTrace();
              } catch (Exception ex) {
                  System.out.println(&quot;3:fullTextEntityManager.createIndexer().startAndWait();&quot;);
                  try {
                      fullTextEntityManager.createIndexer().startAndWait();
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
                  ex.printStackTrace();
              }
              try {
                  session.getTransaction().commit();
              } catch (Exception e) {
                  session.getTransaction().rollback();
              } 
          }
      });
  </code></pre>
  <p>Kindly throw some light on this.</p>