how to configure both mongodb and postgres in spring boot application.yml?

Bravo

We have spring boot project , in which we need to use mongo and postgres , but i thought am failing in configuring mongo and postgres details applicaiton.yml , below my what i configured , can any one please help me

spring:
    profiles: stage
    data:
      mongodb:
        host: mongodb-host
        port: 27017
        password: password
        username: username
        authentication-database: database
        database: database
    datasource:
        driver-class-name: org.postgresql.Driver
        url: postgres-url
        username: user-name
        password: password
        tomcat:
          validation-interval: 30000
          test-on-borrow: true
          validation-query: SELECT 1

when i start my spring-boot application , it is failing to start with below error

Caused by: java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.

can any one please help

Alien

Solution 1: remove spring.datasource.driver-class-name property

Solution 2: rename the spring.datasource.url property to spring.datasource.jdbc-url.

For solution 1 Spring Boot will figure out the default driver class name based on the spring.datasource.url property value.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to fix UnsatisfiedDependencyException in spring boot with mongodb application?

分類Dev

How to configure async timeout in embedded jetty using spring boot application

分類Dev

Spring Bootのapplication.ymlとapplication.properties

分類Dev

Spring Boot application.ymlの環境変数

分類Dev

Spring Boot not loading keystore specified in application.yml

分類Dev

Spring boot yml configuration

分類Dev

How to configure HandlerMethodArgumentResolver in spring boot test

分類Dev

how to configure my application with spring security?

分類Dev

Spring boot - configure EntityManager

分類Dev

Spring Bootはapplication.yml設定をロードしません

分類Dev

Spring Boot-application.ymlからマップを挿入する

分類Dev

spring-boot--application.yml-の内部特殊文字の使用方法#

分類Dev

Gitlabシークレット変数>>> Spring Boot application.yml

分類Dev

Unable to read list of user defined class from application.yml file in a Java Spring Boot project

分類Dev

How to run Spring Boot Application as a Service?

分類Dev

How to vacuum database tables in a Spring Boot application?

分類Dev

How configure react app to start in localhost 8080 in spring boot backend

分類Dev

spring-boot-starter-data-mongodb-reactive X509を使用して接続するためのapplication.ymlからのキーストアパスワードの設定

分類Dev

Spring Boot mongoDB jars

分類Dev

Yml config files "Inheritance" with Spring boot

分類Dev

Spring boot application intellij

分類Dev

Embedded Postgres for Spring Boot Tests

分類Dev

Embedded Postgres for Spring Boot Tests

分類Dev

Spring-Bootのapplication.ymlファイルからcronを取得します

分類Dev

Spring Boot 2.0.0.M4は、application.ymlのhttp基本認証を壊します

分類Dev

Togglzはapplication.ymlからSpring-Boot構成を取得しません

分類Dev

How to change the port of a Spring Boot application using Gradle?

分類Dev

How to connect to a remote mysql over ssh tunnel in spring boot application

分類Dev

How to access defined in the application.properties file in Spring Boot?

Related 関連記事

  1. 1

    How to fix UnsatisfiedDependencyException in spring boot with mongodb application?

  2. 2

    How to configure async timeout in embedded jetty using spring boot application

  3. 3

    Spring Bootのapplication.ymlとapplication.properties

  4. 4

    Spring Boot application.ymlの環境変数

  5. 5

    Spring Boot not loading keystore specified in application.yml

  6. 6

    Spring boot yml configuration

  7. 7

    How to configure HandlerMethodArgumentResolver in spring boot test

  8. 8

    how to configure my application with spring security?

  9. 9

    Spring boot - configure EntityManager

  10. 10

    Spring Bootはapplication.yml設定をロードしません

  11. 11

    Spring Boot-application.ymlからマップを挿入する

  12. 12

    spring-boot--application.yml-の内部特殊文字の使用方法#

  13. 13

    Gitlabシークレット変数>>> Spring Boot application.yml

  14. 14

    Unable to read list of user defined class from application.yml file in a Java Spring Boot project

  15. 15

    How to run Spring Boot Application as a Service?

  16. 16

    How to vacuum database tables in a Spring Boot application?

  17. 17

    How configure react app to start in localhost 8080 in spring boot backend

  18. 18

    spring-boot-starter-data-mongodb-reactive X509を使用して接続するためのapplication.ymlからのキーストアパスワードの設定

  19. 19

    Spring Boot mongoDB jars

  20. 20

    Yml config files "Inheritance" with Spring boot

  21. 21

    Spring boot application intellij

  22. 22

    Embedded Postgres for Spring Boot Tests

  23. 23

    Embedded Postgres for Spring Boot Tests

  24. 24

    Spring-Bootのapplication.ymlファイルからcronを取得します

  25. 25

    Spring Boot 2.0.0.M4は、application.ymlのhttp基本認証を壊します

  26. 26

    Togglzはapplication.ymlからSpring-Boot構成を取得しません

  27. 27

    How to change the port of a Spring Boot application using Gradle?

  28. 28

    How to connect to a remote mysql over ssh tunnel in spring boot application

  29. 29

    How to access defined in the application.properties file in Spring Boot?

ホットタグ

アーカイブ