Trying to implement jpa and mongodb on springboot application with Eureka . its seems that there is a conflict created by spring on selecting the driver that it should run this error show up :

***************************
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).

in search for this error i found that it would be fixed by excluding datasource like this :

@EnableAutoConfiguration(exclude= {DataSourceAutoConfiguration.class })

sure it worked But the application dosent run properly it's like it removed JPA dependency from the application

Is there an another fix or this coexistance can't be in a SpringBoot application ?

Comment From: Laeeq-Khan

Can you show your application.propertices file configurations ?

Comment From: IyadhBoussetta

Here is my application.yml File :

server.port: 8080

spring:
  application.name: pointage-service
  data.mongodb:
    uri: mongodb://localhost:27017/pointage


  profiles:
    active: "@active.profile@"
    include:
    - eureka

Comment From: snicoll

The error you have is telling you Spring Boot can't configure a JDBC DataSource because you didn't provide a URI and no embedded datasource could be found. That's spring.datasource.uri.

Are you trying to use JPA over MongoDB or something?

Comment From: IyadhBoussetta

Yes that's what I am trying to do , How should it be configured ? spring.datasource.uri

Comment From: snicoll

Yes that's what I am trying to do ,

Spring Does uses Hibernate as the JPA provider and I am not aware that it does support that. Spring Boot does not provide auto-configuration for that.

I think we already had such issue in the past but I don't seem to be able to find it back.

Comment From: philwebb

At this point in time we're not planning to support MongoDB as a back-end for JPA since Hibernate ORM doesn't support it.