org.springframework.beans.factory.BeanCreationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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
    via by Artur Konczak,
  • 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
    via by Artur Konczak,
  • Autowired JpaRepository is always null
    via Stack Overflow by Vineet
    ,
  • JPA Repository not working properly
    via Stack Overflow by Atul Kumar
    ,
    • 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)

    Users with the same issue

    Axelo
    1 times, last one,
    Unknown visitor1 times, last one,
    Malcshour
    2 times, last one,
    slash
    11 times, last one,
    aidoan
    2 times, last one,
    19 more bugmates