Restful server error in Tomcat

Asked

Viewed 108 times

0

Could someone help a server problem REST?

I’m developing an app android and I’m working with a server restful, database Postgres and Tomcat.

And I’m making that mistake almost every time I make several requests:

GRAVE: 
Servlet.service() for servlet [Jersey REST Service] in context with path [/Servidor] threw exception 
[javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Um erro de E/S
ocorreu ao enviar para o processo do servidor.] 
with root cause
java.net.SocketTimeoutException: Read timed out
  at java.net.SocketInputStream.socketRead0(Native Method)

And this mistake too:

[javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Um erro de E/S
ocorreu ao enviar para o processo do servidor.] 
with root cause
java.net.SocketTimeoutException: Read timed out
  at java.net.SocketInputStream.socketRead0(Native Method)
  • Your server cannot connect to the database. What is the database URL? Are you sure the database is running correctly? If you ping from your server to the IP of your database works? Are you sure some firewall isn’t blocking connections by entering the Postgresql port of the database or blocking connections by exiting the server?

  • So, the connection is correct, the firewall is not blocking the connections in the Postgresql port. These exceptions of java.net.Socketexception and java.net.Sockettimeoutexception, happen when sending requests from the app to the server, just in this scenario. @Victorstafusa

  • Well, the message makes it clear that a JDBCConnectionException occurs in the Servlet.service(). That is, the server trying to talk to the database. This gives to understand strongly that the problem is in the server, and not in the app.

  • Yes, that’s very clear. Would you have any hints? Because I’m starting in java and this is the first time I’ve made this mistake. @Victorstafusa

  • You can edit your question to add more details about your code and about the error obtained?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.