Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException

前端 未结 3 2014
花落未央
花落未央 2021-02-08 21:56

when i run my code, i get this exception:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully         


        
3条回答
  •  梦毁少年i
    2021-02-08 22:34

    I was not unable to figure out the exact cause, but I realized that it was because of some thread pools since I was able to connect to the db using the terminal. for checking the connectivity you can use the below command.

    psql -h hostname -U username -d database
    

    so restarting the server worked for me.

提交回复
热议问题