I have a spring project which connects to remote MySQL database and displays data from it. The app was tested in Eclipse on tomcat localhost server and there were no problems. later on, I extracted the project in .war format and uploaded it on openshift.com server, and it worked for more than 2 weeks. But suddenly, now I get this error when I open it on that server:
HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
type Exception report
message Request processing failed; nested exception is java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
I immediately opened the same project in Eclipse (connected to that online database) and there was no error. I extracted the app in new .war file and deleted the old one on the server and replaced it with new one. And guess what, still the same exception occurs. So basically, I have one application, which connects to remote database, and it works fine when I run it on localhost, but suddenly does not work when I put it on some hosting server (it was working on that server for some good time which is weird). What could have gone wrong?