Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello,
I am connecting Postgresql Managed Database(From DO) with pgadmin4(local Postgresql) so that I can deploy spring boot application on Ubuntu server(Droplet). The local database created on pgadmin4 also reflects on Droplet with tables and data in it. I am getting errors related to Database when I run spring boot application.
java -jar App_Service-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod
The spring boot application is running without any errors on local machine but has errors on Ubuntu machine(droplet).
Attaching files related to it:
username = doadmin
password = ************************ show
host = db-******-**********************.ondigitalocean.com
port = ****
database = MyDB
sslmode = require
server:
port: 1234
servlet:
context-path: /lms
spring:
datasource:
url: jdbc:postgresql://localhost:5432/MYDB
username: postgres #changed as per Local DB
password: **** #changed as per Local DB
spring.jpa:
database: POSTGRESQL
hibernate.ddl-auto: create-drop
show-sql: true
spring.jpa.hibernate.ddl-auto = update
jackson.deserialization.fail-on-unknown-properties: true
jackson.serialization.fail-on-empty-beans: false
mvc.hiddenmethod.filter.enabled: true
main.allow-bean-definition-overriding: true
#hibernate ddl Auto for CURDOperations
jpa.hibernate.ddl-auto: none
spring:
profiles:
active: dev
---
spring:
profiles: dev
server:
port: ****
servlet:
context-path: /lms
spring:
datasource:
url: jdbc:postgresql://localhost:5432/MYDB
username: postgres #changed as per Local DB
password: **** #changed as per Local DB
spring.jpa:
database: POSTGRESQL
hibernate.ddl-auto: create-drop
show-sql: true
spring.jpa.hibernate.ddl-auto = update
jackson.deserialization.fail-on-unknown-properties: true
jackson.serialization.fail-on-empty-beans: false #
mvc.hiddenmethod.filter.enabled: true
main.allow-bean-definition-overriding: true
#hibernate ddl Auto for CURDOperations
jpa.hibernate.ddl-auto: none
---
spring:
profiles: prod
server:
port: **** #port number from DO
servlet:
context-path: /lms
database-platform : org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto : create
spring:
jpa:
database: POSTGRESQL
show-sql: true
hibernate:
ddl-auto: create-drop
datasource:
platform: postgres
url: jdbc:postgresql://db-***********************.ondigitalocean.com:****/MYDB #digital ocean host with port number
username: doadmin #digital ocean username
password:******************** #digital ocean password
driverClassName: org.postgresql.Driver
jackson.deserialization.fail-on-unknown-properties: true
jackson.serialization.fail-on-empty-beans: false #
mvc.hiddenmethod.filter.enabled: true
main.allow-bean-definition-overriding: true
#hibernate ddl Auto for CURDOperations
2022-12-13 15:43:24.646 WARN 149006 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 28P01
2022-12-13 15:43:24.648 ERROR 149006 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : FATAL: password authentication failed for user "postgres"
2022-12-13 15:43:24.663 ERROR 149006 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
2022-12-13 15:43:24.665 WARN 149006 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
2022-12-13 15:43:24.672 INFO 149006 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-12-13 15:43:24.729 INFO 149006 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-12-13 15:43:24.793 ERROR 149006 --- [ main] o.s.boot.SpringApplication : Application run failed
b4dbf29d32f847318da467ebae7220
Sen Wang
4d93f2f07ce540cbb84c4d97e835bc
51e1519ea1b54919ac6d35aa324db5
jajaen
14ed7f5e756d40a9971bfff98e543a
14ed7f5e756d40a9971bfff98e543a
75661e8e526d4284a527b3ccb913ca