title: PostgreSQL Java Authentication error
body: <p>I am trying to connect netbeans with postgreSQL. However, it gives connection error even though my username and password is correct. Following code is my persistence.xml. Can you help me please?</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
    &lt;persistence-unit name="travelling" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
      &lt;class&gt;com.travelling.entity.CbrCase&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrCaseAttraction&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrAttractionXCategory&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrCategory&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrAttraction&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrCaseXCategory&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrDay&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrDayXAttraction&lt;/class&gt;
      &lt;class&gt;com.travelling.entity.CbrAttractionXAttraction&lt;/class&gt;
      &lt;properties&gt;  
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/&gt;
          &lt;property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/travelling"/&gt;
          &lt;property name="hibernate.connection.username" value="*****"/&gt;
          &lt;property name="hibernate.connection.password" value="*****"/&gt;
          &lt;property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/&gt;
          &lt;property name="hibernate.show_sql" value="true"/&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>and this is the error:</p>
  
  <pre><code>Internal Exception: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
  </code></pre>
  
  <p>and i am pretty sure my password is correct because i can log in with the same password to the database.</p>