Skip to content
Advertisement

Connecting Spring boot application with postgresql problem with properties

I wanted to connect my application from spring boot with postgresql running in docker I am doing everything according to this tutorial – https://www.youtube.com/watch?v=8fbfHu8isI4&t=1452s , but I keep getting the same error:

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled. 2021-08-02 16:18:56.400 ERROR 4169 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

Process finished with exit code 1

This is connecting with database

PostgresDataSource:

JavaScript

in application.yml

JavaScript

I have these problems in application.yml and I have no idea what is wrong

enter image description here

Advertisement

Answer

You have a typo in this line:

JavaScript

You should fix it to:

JavaScript

When using the guides, always look at the description. Sometimes there is a source code.

Guider application.yml file

As @grekier stated you should also add @Configuration to PostgresDatasource class.

Guider Datasource file

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement