org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleElasticsearchRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample!

Spring JIRA | Artur Konczak | 3 years ago
  1. 0

    Hi - I am attempting to use the spring-data-elasticsearch module in a spring boot project. Things work ok till I attempt to configure a NoSQL store (mongodb) in the same project. At that point, on application startup, I get this... Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleElasticsearchRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample! at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:482) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:616) at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) at org.springframework.boot.SpringApplication.run(SpringApplication.java:877) at org.springframework.boot.SpringApplication.run(SpringApplication.java:866) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at sample.SampleApplication.main(SampleApplication.groovy:50) Caused by: org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample! at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:359) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) The sample is available on github for your reference @ https://github.com/berinle/bootsample/tree/es The issue seems to be that mongo and ES spring data module can't exist in the same project. Seems to be confusing the start up of the application somehow. Question: Why such a restriction? Can one still use your module along with other NoSQL store modules? If so, can you shed some light on what I am missing? How to reproduce issue: After you clone the project and switch to the es branch, run ./gradlew test from the console (if you are on unix) or gradlew.bat test (if you are on windows) to run the tests and watch it fail. You can then open the HTML reports and see the error I reported. Let me know if I can provide anything further to help you diagnose the issue. Thanks Bayo

    Spring JIRA | 3 years ago | Artur Konczak
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleElasticsearchRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample!
  2. 0

    Hi - I am attempting to use the spring-data-elasticsearch module in a spring boot project. Things work ok till I attempt to configure a NoSQL store (mongodb) in the same project. At that point, on application startup, I get this... Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleElasticsearchRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample! at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:482) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:616) at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) at org.springframework.boot.SpringApplication.run(SpringApplication.java:877) at org.springframework.boot.SpringApplication.run(SpringApplication.java:866) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at sample.SampleApplication.main(SampleApplication.groovy:50) Caused by: org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample! at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:359) at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) The sample is available on github for your reference @ https://github.com/berinle/bootsample/tree/es The issue seems to be that mongo and ES spring data module can't exist in the same project. Seems to be confusing the start up of the application somehow. Question: Why such a restriction? Can one still use your module along with other NoSQL store modules? If so, can you shed some light on what I am missing? How to reproduce issue: After you clone the project and switch to the es branch, run ./gradlew test from the console (if you are on unix) or gradlew.bat test (if you are on windows) to run the tests and watch it fail. You can then open the HTML reports and see the error I reported. Let me know if I can provide anything further to help you diagnose the issue. Thanks Bayo

    Spring JIRA | 3 years ago | Artur Konczak
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleElasticsearchRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property search found for type Sample!
  3. 0

    How to write Spring Data method name to retrieve all elements in a column?

    Stack Overflow | 3 years ago | m3th0dman
    org.springframework.data.mapping.PropertyReferenceException: No property find found for type Trade at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:75)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Autowired JpaRepository is always null

    Stack Overflow | 3 years ago | Vineet
    org.springframework.data.mapping.PropertyReferenceException: No property find found for type com.myclassregister.model.base.misc.School at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:75)
  6. 0

    Spring Data JPA and QueryDSL - No property find found for type

    Stack Overflow | 2 years ago | sunghun
    org.springframework.data.mapping.PropertyReferenceException: No property find found for type entities.Device at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:75)

  1. Malcshour 2 times, last 6 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.data.mapping.PropertyReferenceException

    No property search found for type Sample!

    at org.springframework.data.mapping.PropertyPath.<init>()
  2. Spring Data Core
    PropertyPath.from
    1. org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75)
    2. org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)
    3. org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:359)
    4. org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)
    5. org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270)
    5 frames