for first sorry for my english.
I've a strange issue with my development environment on my iMac.
I'm developing a Spring Java Web Application with a MySQL 5.7 DB and Tomcat 8.
At the first start everything works fine but after less than an hour and after a few build and re-deploy of my Web Application on the Servlet Container, suddenly It's impossible to reach the Database and I got the errors below:
... The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory Communications link failure ...
I precise that MySQL is up and running correctly and I can connect and run queries into it with the terminal client or MySQL Workbench.
Restart of the RDBMS does not effect. Restart of Tomcat does not effect.
The only thing that works is to reboot my computer, but after severl time and few redeploy the same thing occurs again.
It's seems not a problem related to the Web Application (JDBC Connection Pool is correctly configured) or the MySQL instance.
No firewall seems active.
Could be a possibile issue with my Network card? How to check it?
Thanks in advance.
UPDATE: I passed "-Djava.net.preferIPv4Stack=true" argument in the Java Launch configuration as suggested in another thread and It solved partially.
Now The Web application starts without restarting the computer but doesn't respond on http://localhost:8080/myapp Browser tab remain in permanent loading.
I need to call http://127.0.0.1:8080/myapp and It works
It's seems localhost is not resolved correctly and maybe there's an issue with IPV4 - IPV6 but I didn't change anything to my network config.