spring-data-solr : BeanCreationException for Repository interface -
i trying use spring-data-solr (1.4.0) searching names solr. created solrrepository interface mentioned below getting beancreationexception on server startup. below stack trace.
can please suggest wrong here?
@service("searchservice") public class searchserviceimpl implements searchservice { @autowired private solrrepository solrrepository;
public interface solrrepository extends solrcrudrepository<namedocument,string> { @query("fullname:*?0* or nickname:*?0*") public list<namedocument> searchname(string searchstring); }
@configuration @enablesolrrepositories("com.test.solr.repository") public class solrcontext { @bean public solrserver solrserver() throws malformedurlexception { return new httpsolrserver("http://localhost:8983/solr"); } @bean public solrtemplate solrtemplate(solrserver server) throws exception { return new solrtemplate(server); } }
caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'searchservice': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private com.test.solr.repository.solrrepository com.test.search.service.searchserviceimpl.solrrepository; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'solrrepository': post-processing of factorybean's singleton object failed; nested exception org.springframework.aop.framework.aopconfigexception: not generate cglib subclass of class [class com.sun.proxy.$proxy48]: common causes of problem include using final class or non-visible class; nested exception java.lang.illegalargumentexception: cannot subclass final class class com.sun.proxy.$proxy48 at org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:292) at org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1185) at org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:537) at org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) at org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:302) at org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:228) at org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:298) at org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:198) at org.springframework.context.annotation.commonannotationbeanpostprocessor.autowireresource(commonannotationbeanpostprocessor.java:446) at org.springframework.context.annotation.commonannotationbeanpostprocessor.getresource(commonannotationbeanpostprocessor.java:420) at org.springframework.context.annotation.commonannotationbeanpostprocessor$resourceelement.getresourcetoinject(commonannotationbeanpostprocessor.java:545) at org.springframework.beans.factory.annotation.injectionmetadata$injectedelement.inject(injectionmetadata.java:155) at org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:87) at org.springframework.context.annotation.commonannotationbeanpostprocessor.postprocesspropertyvalues(commonannotationbeanpostprocessor.java:305) ... 29 more caused by: org.springframework.beans.factory.beancreationexception: not autowire field: private com.test.solr.repository.solrrepository com.test.search.service.searchserviceimpl.solrrepository; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'solrrepository': post-processing of factorybean's singleton object failed; nested exception org.springframework.aop.framework.aopconfigexception: not generate cglib subclass of class [class com.sun.proxy.$proxy48]: common causes of problem include using final class or non-visible class; nested exception java.lang.illegalargumentexception: cannot subclass final class class com.sun.proxy.$proxy48 at org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:508) at org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:87) at org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:289) ... 42 more caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'solrrepository': post-processing of factorybean's singleton object failed; nested exception org.springframework.aop.framework.aopconfigexception: not generate cglib subclass of class [class com.sun.proxy.$proxy48]: common causes of problem include using final class or non-visible class; nested exception java.lang.illegalargumentexception: cannot subclass final class class com.sun.proxy.$proxy48 at org.springframework.beans.factory.support.factorybeanregistrysupport.getobjectfromfactorybean(factorybeanregistrysupport.java:116) at org.springframework.beans.factory.support.abstractbeanfactory.getobjectforbeaninstance(abstractbeanfactory.java:1512) at org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:313) at org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:193) at org.springframework.beans.factory.support.defaultlistablebeanfactory.findautowirecandidates(defaultlistablebeanfactory.java:1017) at org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:960) at org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:858) at org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:480) ... 44 more caused by: org.springframework.aop.framework.aopconfigexception: not generate cglib subclass of class [class com.sun.proxy.$proxy48]: common causes of problem include using final class or non-visible class; nested exception java.lang.illegalargumentexception: cannot subclass final class class com.sun.proxy.$proxy48 at org.springframework.aop.framework.cglibaopproxy.getproxy(cglibaopproxy.java:212) at org.springframework.aop.framework.proxyfactory.getproxy(proxyfactory.java:109) at org.springframework.aop.framework.autoproxy.abstractautoproxycreator.createproxy(abstractautoproxycreator.java:494) at org.springframework.aop.framework.autoproxy.abstractautoproxycreator.wrapifnecessary(abstractautoproxycreator.java:379) at org.springframework.aop.framework.autoproxy.abstractautoproxycreator.postprocessafterinitialization(abstractautoproxycreator.java:339) at org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applybeanpostprocessorsafterinitialization(abstractautowirecapablebeanfactory.java:421) at org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.postprocessobjectfromfactorybean(abstractautowirecapablebeanfactory.java:1698) at org.springframework.beans.factory.support.factorybeanregistrysupport.getobjectfromfactorybean(factorybeanregistrysupport.java:113) ... 51 more caused by: java.lang.illegalargumentexception: cannot subclass final class class com.sun.proxy.$proxy48 at org.springframework.cglib.proxy.enhancer.generateclass(enhancer.java:446) at org.springframework.cglib.transform.transformingclassgenerator.generateclass(transformingclassgenerator.java:33) at org.springframework.cglib.core.defaultgeneratorstrategy.generate(defaultgeneratorstrategy.java:25) at org.springframework.cglib.core.abstractclassgenerator.create(abstractclassgenerator.java:216) at org.springframework.cglib.proxy.enhancer.createhelper(enhancer.java:377) at org.springframework.cglib.proxy.enhancer.createclass(enhancer.java:317) at org.springframework.aop.framework.objenesiscglibaopproxy.createproxyclassandinstance(objenesiscglibaopproxy.java:57) at org.springframework.aop.framework.cglibaopproxy.getproxy(cglibaopproxy.java:202) ... 58 more
Comments
Post a Comment