- Your pg-db needs to be accepting database connections, set tcpip to yes in your postgres.conf.
- Check that your pg_hba.conf is set correctly.
- Check that your any packetfilter or iptables is functioning correctly.
- Set <MaxIdle> to a relatively high level compare to <MaxActive>, <MaxActive is the actual number of tcp/ip connections openend to your pg-database. <MaxIdle> is the number of open database connections your web applications can handle.
- Never call connection.close(). The DataSource implementation should be handling that.
- Be sure to have defined the <resource> in the right place.