0

The exception PropertyReferenceException: No property getOne found for type XYZ fires on all repositories i have.

Example for one of my repos :

public interface SitePageRepository extends JpaRepository<SitePage, Long>, JpaSpecificationExecutor<SitePage> {
void deleteAllByStaticPageIsFalse();
}

They were working fine before(i did not do any change on the repos), the change i did is that i moved some shared entities and repositories to another project, then i added its dependency to my main project.

I added

@EnableJpaRepositories({"com.example.mainApp", "com.example.shared"})

Then the exceptions on repositories in my main app happened at runtime.

I returned the repositories from the external project and removed the EnableJpaRepositories annotation and then the project run successfully.

Any suggestions?

  • Possible duplicate of [Spring Data JPA - "No Property Found for Type" Exception](https://stackoverflow.com/questions/19583540/spring-data-jpa-no-property-found-for-type-exception) – XtremeBaumer Nov 11 '19 at 09:28
  • Let me guess you also updated the Spring Data version you are using... Maybe by accident, but updated nontheless. – M. Deinum Nov 11 '19 at 09:28
  • @XtremeBaumer No, i don't have any incorrect naming, the repositories were working fine, until i made the change described! – Mohammad Makahleh Nov 11 '19 at 09:39
  • @M.Deinum No, i checked the changes and no versioning difference – Mohammad Makahleh Nov 11 '19 at 09:41
  • As stated you haven't changed the version but due to moving thigns around the version still might have changed. – M. Deinum Nov 11 '19 at 09:49
  • @M.Deinum Sorry, i explicitly set the Spring Data version the same and still i have the error – Mohammad Makahleh Nov 11 '19 at 10:13
  • The `getOne` doesn;'t exists anymore in newer versions, so the only conclusion I can draw is that you initially had an older version then you have now. Which is the result of moving around the dependencies. Check your old version with `mvn dependency:tree` and the new version and find the differences. Also make sure you aren't mixing jars from different versions of Spring and Spring Data as that will also lead to weird issues. – M. Deinum Nov 11 '19 at 10:18
  • @M.Deinum I rechecked all versions to be compatible and still Not working. I returned the repositories from the external project and removed the EnableJpaRepositories annotation and then the project run successfully.. any ideas? – Mohammad Makahleh Nov 11 '19 at 11:10

0 Answers0