malteseduck / spring-data-marklogic

An implementation of the Spring Data interfaces for the MarkLogic NoSQL database
Apache License 2.0
7 stars 9 forks source link

Configuring Driver Class for Spring Data JPA #49

Open rosenjcb opened 5 years ago

rosenjcb commented 5 years ago

If I use Spring Data JPA, I need to set up a spring.datasource.url or else I get the error:

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

I get around this right now by adding this annotation to my Application class: @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})

But I was wondering if there's a better way to get around this issue. Thank you.

malteseduck commented 4 years ago

It is probably the best:

https://www.baeldung.com/spring-boot-failed-to-configure-data-source

If you are using Spring Data JPA then you should configure a data source for your relational DB, though, otherwise don't include it? Are you using some other classes in there but don't have a relational database?