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?
Related
I try to upgrade my app using Play Framework 1.3.1 to last version 1.7.1. I have this error :
~ ERROR: java version prior to 11 are no longer supported: current version "1.8.0_311" : please update
Exception in thread "main" java.lang.UnsupportedClassVersionError: play/classloading/HotswapAgent has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I have upgraded my Java to jdk-11.0.17, my server can start, but displaying the home Web page, I have this error :
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
17:43:23.519 [play-thread-1] ERROR play - Database [default] Cannot connected to the database : 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.
com.mysql.cj.jdbc.exceptions.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.
...
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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.
...
Caused by: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
...
Caused by: java.io.EOFException: SSL peer shut down incorrectly
My app is configure to connect to local MySql version 5.5.62.
I have tried with Java 17 or 19 without success.
I have done many searches on internet but I cannot find any help or solution.
I cannot find which Java version I have to use with Play 1.7.1.
Thanks for any help or suggestions,
Xavier
I made CICD pipeline with Codedeploy, ec2 and s3 and it is successful.
and then I attach rds to the pipeline but I failed.
AWS RDS works well in local program, but when Spring deploy in EC2, the connection with RDS is not working
This is message
com.mysql.cj.jdbc.exceptions.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.
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
Caused by: java.net.ConnectException: Connection refused
This is my ec2 and rds security inbound
ec2 :
rds :
Many people say that add ec2 security group to rds security group, but already I did and problem is not solving.
What is real problem?
I close all firewall of my computer
This project was successfully deployed in studio. But when I deploy in cloudhub it shows the error. I am using mysql database. Can any one solve?
org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:mysql://127.0.0.1:3306/company : 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. (java.sql.SQLException) (org.mule.module.db.internal.processor.DbConnectionException).
You are trying to connect to a MySQL database in your computer. That worked in Studio because you had the database running there. In the CloudHub deployment there is not, and will never be, a database running. You need to change the JDBC URL to point to a real database that is somewhere else and it is actually accessible from your CloudHub deployed application. That is something you need to resolve, not a problem with CloudHub.
I developed a spring MVC application that interacts with mySql and when I was satisfied that it was working 100% of the time locally on my own computer I put it online using a hosting service. However, I've had nothing but problems and am trying to work out if the source is my code or a problem with the host.
Sometimes my application works fine, and at other times I get a http status 500 internal server error so that would lead me to believe that the problem is with the host and not my application.
Unfortuneatly the error is saved as a pdf that I can't upload to your site but it says the problem is:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: communications link failure
Please note that on this hosting site I have my own private tomcat server. Also, I use connection pooling to connect to the database.
Any help would be appreciated.
Sorry, I also get the following error message at the bottom of the error 500 page:
java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost
in brief:
[Problem in glassfish Admin console when I try to Create a new JDBC Connection Pools]
can someone help me please solve this problem :
firstly, I want to develop a JSF application on Netbeans IDE 8.1
when I fill the page of creating a new JDBC Connection Pools glassfish console throws this Exception :
type : Exception report
message :Internal Server Error
description : The server encountered an internal error that prevented it from fulfilling this request.
exception :
java.lang.IllegalStateException: getOutputStream() has already been called for this response
note : The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs.
see this pictures for more informations :
glassfish Admin console
domain.XML
I found a solution to my problem in this tutorial :
https://netbeans.org/kb/docs/javaee/javaee-gettingstarted-pf-screencast.html