Closed jordanbaucke closed 6 years ago
Your issue looks like https://github.com/Cosium/spring-data-jpa-entity-graph/issues/8
Are you certain that @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class)
was taken into account?
Can you put a breakpoint in the factoryBean class to check it is the one that is used?
Also can I see the User class?
And could you try to disable Elasticsearch
and/or Auditing
to see if the issue could come from here?
@reda-alaoui which factory bean class?
EntityGraphJpaRepositoryFactoryBean
@reda-alaoui
Here is User Class (relevant parts at least) https://gist.github.com/jordanbaucke/125f7a47eb224aeeb25d4b40ecf41f6e,
And current UseRepository: https://gist.github.com/jordanbaucke/7b14b3c939774b59063d980feb191016
I do not get to loading EntityGraphJpaRepositoryFactoryBean
, as SpringSecurity kicks in and throws:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataInitalizer': Unsatisfied dependency expressed through field 'dataInitializationService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataInitializationServiceImpl': Unsatisfied dependency expressed through field 'passwordEncoder'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfiguration': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService': Unsatisfied dependency expressed through field 'userRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property getOne found for type User!
I see a compilation error inside the dependency.
What version of Spring Data are you using?
Can you paste the relevant pom.xml
or gradle
files parts?
compile "org.springframework.boot:spring-boot-starter-data-jpa"
...
compile "com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0"
??
I need to know which version of https://github.com/spring-projects/spring-data-jpa you are using.
Sorry:
Appears to be org.springframework.data:spring-data-jpa:1.10.5.RELEASE
, so I should change my version of com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
~/Documents/workspace/api$ gradle dependencies | grep spring-data
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
\--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
| +--- org.springframework.data:spring-data-jpa:1.10.5.RELEASE
| | +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE
| \--- org.springframework.data:spring-data-elasticsearch:2.0.5.RELEASE
| +--- org.springframework.data:spring-data-commons:1.12.5.RELEASE (*)
| +--- org.springframework.data:spring-data-commons:1.12.2.RELEASE -> 1.12.5.RELEASE (*)
+--- com.cosium.spring.data:spring-data-jpa-entity-graph:2.0.0
Yes you must use a 1.10.x version of this library.
I have followed [2.0 quickstart guide](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/doc/MAIN.md,
In my database configuration I had:
Now if I switch:
to:
I than add a new repository:
in addition to:
I get exception:
If I just replace
extends JpaRepository
w/EntityGraphJpaRepository
, I get: