When I launch my server before starting up the PostgreSql DB, I get the following error, and it will continue for ever.
org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:204)..............
How and where should I catch it in my program. It looks like a infinite loop that is generated by Configuration.buildSessionFactory(). I used
catch(Exception e) by can not get it.
|