title: sqlite path in hibernate.cfg.xml on glassfish server
body: <p>I'm trying to use sqlite using hibernate. However, I've had hard time, configuring sqlite database path. Currently, my <code>hibernate.cfg.xml</code> looks like this:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD//EN"
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name="connection.url"&gt;jdbc:sqlite:test.db&lt;/property&gt;
          &lt;property name="connection.driver_class"&gt;org.sqlite.JDBC&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.SQLiteDialect&lt;/property&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
          &lt;mapping class="com.test.entity.Category"/&gt;
          &lt;!-- DB schema will be updated if needed --&gt;
          &lt;!-- &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt; --&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I'm using IntelliJ. I've placed test.db in resources &amp; in the artifacts I could see it in classes package. However, everytime I get this error:</p>
  
  <pre><code>org.hibernate.hql.internal.ast.QuerySyntaxException: Category is not mapped [select id from Category]
  </code></pre>
  
  <p><strong>Category.java</strong></p>
  
  <pre><code>@Entity
  @Table(name = "category", schema = "", catalog = "")
  public class Category {
      private String id;
      private String name;
      private String imageUrl;
  
      @Id
      @Column(name = "id")
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      @Basic
      @Column(name = "name")
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      @Basic
      @Column(name = "imageUrl")
      public String getImageUrl() {
          return imageUrl;
      }
  }
  </code></pre>
  
  <p><strong>HibernateUtil.java</strong></p>
  
  <pre><code>public class HibernateUtil {
  
      private static SessionFactory sessionFactory;
  
      private static SessionFactory buildSessionFactory() {
          try {
              Configuration configuration = new Configuration();
              configuration.configure("hibernate.cfg.xml");
  
              ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(
                      configuration.getProperties()).build();
              return configuration.buildSessionFactory(serviceRegistry);
  
          } catch (Throwable ex) {
              System.err.println("Initial SessionFactory creation failed." + ex);
              throw new ExceptionInInitializerError(ex);
          }
      }
  
      public static SessionFactory getSessionFactory() {
          if(sessionFactory == null){
              sessionFactory = buildSessionFactory();
          }
          return sessionFactory;
      }
  
      public static void shutdown() {
          getSessionFactory().close();
      }
  }
  </code></pre>
  
  <p>I'm using Hibernate version 5.1.0</p>
  
  <p>I've checked <code>sessionFactory.getAllClassMetadata()</code> - it shows no class mapped. Any help would be greatly appreciated.</p>