title: Can't connect to Postgre Database from Tomcat 8.0 on Windows 8 machine - authentication error
body: <p>Using Tomcat 8.0 and Postgre on Windows (8), and I get the following error when trying to connect to the database (both Tomcat and Postgre are local installs).</p>
  
  <p>org.postgresql.util.PSQLException: FATAL: password authentication failed for user "user" java.lang.NullPointerException</p>
  
  <p>I confirmed the login information with the user settings in Postgre and the user is set as the owner of the database with all permissions.</p>
  
  <p>The database can be connected to from pgAdmin III alright and queried.</p>
  
  <p>I've added the following line to pg_hba.conf</p>
  
  <p>host    all         all         127.0.0.1/32          md5</p>
  
  <p>I've set the listen address to "*" in postgresql.conf.</p>
  
  <p>Using the following to connect:</p>
  
  <pre><code>static String url = "jdbc:postgresql://127.0.0.1:5432/database";
  static String user = "user";
  static String password = "password";
  
  Connection conn = DriverManager.getConnection(url, user, password);
  </code></pre>
  
  <p>Disabled any firewalls, etc, just in case.</p>
  
  <p>I've looked through similar threads, and the solutions for other people hasn't worked for me. Any ideas would be really appreciated.</p>