0

I got a problem in one of my cloud server today and it was restarted by the administrators when action was in progress. Since the restart of the server my backend doesn't want to restart, it seems like there is a problem with my postgresql database.

For information : I can connect to the database with the username and the password of the user with no problem and also do modification with pgAdmin or directly with psql.

ERROR c.b.myapp.progress.ProgressServiceImpl.updateProgressApplication (169) - error updating progress for c24f3d42-965b-459e-8afd-2e016ddb3394
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Unsatisfied dependency expressed through method 'dataSource' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Could not bind properties to 'DataSourceProperties' : prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5e57643e has not been refreshed yet
        at [...]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Unsatisfied dependency expressed through method 'dataSource' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Could not bind properties to 'DataSourceProperties' : prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5e57643e has not been refreshed yet
        at [...]
Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Could not bind properties to 'DataSourceProperties' : prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5e57643e has not been refreshed yet
        at [...]
Caused by: java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5e57643e has not been refreshed yet
        at [...]

ERROR o.s.a.i.SimpleAsyncUncaughtExceptionHandler.handleUncaughtException (39) - Unexpected exception occurred invoking async method: public void com.myapp.progress.ProgressServiceImpl.processAllApplications()
org.springframework.orm.jpa.JpaSystemException: Unable to rollback against JDBC Connection; nested exception is org.hibernate.TransactionException: Unable to rollback against JDBC Connection
        at [...]
Caused by: org.hibernate.TransactionException: Unable to rollback against JDBC Connection
        at [...]
Caused by: org.postgresql.util.PSQLException: This connection has been closed.

Can someone help ? (Everything was working fine before this server restart)

Antoine Grenard
  • 1,712
  • 3
  • 21
  • 41
  • Enable connection validation in your properties, that way it will remove the invalid connections. Also mention the fact in your question that you are using Spring Boot and not just Spring. – M. Deinum Aug 19 '20 at 06:56
  • This [question](https://stackoverflow.com/questions/28404817/annotationconfigapplicationcontext-has-not-been-refreshed-yet-whats-wrong) looks similar. – SternK Aug 19 '20 at 07:00
  • How can I enable connection validation ? – Antoine Grenard Aug 19 '20 at 07:56

0 Answers0