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
Go to resources folder where the application.properties is present, update the below code in that.
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
In gradle build i simply:
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-devtools')
removed
**`compile('org.springframework.boot:spring-boot-starter-data-jpa')`**
and it worked for me.
This error occurred when you are putting JPA dependencies in your spring-boot configuration file like in maven or gradle. The solution is: Spring-Boot Documentation
You have to specify the DB connection string and driver details in application.properties file. This will solve the issue. This might help to someone.
Add the line below in application.properties file under resource folder and restart your application.
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
I encountered this error simply because I misspelled the spring.datasource.url
value in the application.properties file and I was using postgresql:
Problem was:
jdbc:postgres://localhost:<port-number>/<database-name>
Fixed to:
jdbc:postgresql://localhost:<port-number>/<database-name>
NOTE: the difference is postgres
& postgresql
, the two are 2 different things.
Further causes and solutions may be found here
adding org.apache.derby dependency solved my issue.
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>