title: JBDS HHH000319: Could not get database metadata: java.sql.SQLException: No suitable driver found
body: <p>I'm having trouble making a webapp work.
  i am using Red Hat JBoss Developer Studio 8.1.0.GA and i encountered an error when deploying.</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/hibernatedb
  </code></pre>
  
  <p>here is my persistence.xml</p>
  
  <pre><code>&lt;persistence-unit name="HibernateProject"
      transaction-type="JTA"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
  
      &lt;class&gt;com.test.model.UserDetails&lt;/class&gt;
      &lt;properties&gt;
          &lt;property name="hibernate.connection.driver.class" value="org.postgresql.Driver"&gt;&lt;/property&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" /&gt;
          &lt;property name="hibernate.show_sql" value="true" /&gt;
          &lt;property name="hibernate.hbm2ddl.auto" value="validate" /&gt;
          &lt;property name="hibernate.connection.url"
              value="jdbc:postgresql://localhost:5432/hibernatedb"&gt;&lt;/property&gt;
          &lt;property name="hibernate.connection.username" value="postgres"&gt;&lt;/property&gt;
          &lt;property name="hibernate.connection.password" value="1234"&gt;&lt;/property&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>here is my servlet</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      UserDetails user = new UserDetails();
      user.setUserName(request.getParameter("username"));
  
      //use persistence-unit name from persistence.xml
      EntityManagerFactory entityFactory = Persistence.createEntityManagerFactory("HibernateProject");
  
      EntityManager entityManager = entityFactory.createEntityManager();
  
      EntityTransaction entityTransaction = null;
  
      try{
          entityTransaction = entityManager.getTransaction();
          entityTransaction.begin();
          entityManager.persist(user);
          entityTransaction.commit();
      }catch(RuntimeException re){
          if(entityTransaction.isActive()){
              entityTransaction.rollback();
              throw re;
          }
      }
  
  }
  </code></pre>
  
  <p>Thanks alot!</p>