Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified

后端 未结 12 1645
逝去的感伤
逝去的感伤 2020-12-23 16:39

I have created a basic spring boot application from SPRING INITIALIZR with the Web, MongoDB and JPA dependencies.

When I try to run the spring boot

12条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-23 17:10

    Since you have added both mongodb and data-jpa dependencies in your pom.xml file, it was creating a dependency conflict like below

    
    org.springframework.boot
    spring-boot-starter-data-jpa
    
    
    org.springframework.boot
    spring-boot-starter-data-mongodb
    
    

    Try removing jpa dependency and run. It should work fine.

提交回复
热议问题