spring - Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -


when autowire bean scope of request.session ,i error.i using spring 3 hibernate. have create proxy around concerete class,so have cglib option. problem of autowiring solved design patterns method injection,factory pattern,but have autowire lot of beans going solution of proxing.

caused by: java.lang.noclassdeffounderror: not initialize class net.sf.cglib.proxy.enhancer @ org.springframework.aop.framework.cglib2aopproxy.createenhancer(cglib2aopproxy.java:228) @ org.springframework.aop.framework.cglib2aopproxy.getproxy(cglib2aopproxy.java:170) @ org.springframework.aop.framework.proxyfactory.getproxy(proxyfactory.java:112) @ org.springframework.aop.scope.scopedproxyfactorybean.setbeanfactory(scopedproxyfactorybean.java:109) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeawaremethods(abstractautowirecapablebeanfactory.java:1422) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1391) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:513) ... 43 more 

here application context code bean needs autowired.

<bean name="registerbean" class="com.clicktoshop.beans.registerbean" scope="request"> <aop:scoped-proxy proxy-target-class="true" /> </bean> 

here controller code

@autowired @qualifier("registerbean") public void setregisterbean(registerbean registerbean) { this.registerbean = registerbean; } 

i have followed below mentioned steps not solution. 1.added cglib-nodep-2.2.3.jar .it didn't solve issue. 2.found spring has org.springsource.net.sf.cglib contains enhancer class dont know why not taking that.

complete stack trace

related cause:

org.springframework.beans.factory.beancreationexception: error creating bean name 'registerbean' defined in beandefinition defined in servletcontext resource [/web-inf/conf/clicktoshop.xml]: initialization of bean failed; nested exception java.lang.noclassdeffounderror: not initialize class net.sf.cglib.proxy.enhancer @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:521) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:450) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:290) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:222) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:287) @ org.springframework.beans.factory.support.abstractbeanfactory.gettypeforfactorybean(abstractbeanfactory.java:1301) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.gettypeforfactorybean(abstractautowirecapablebeanfactory.java:672) @ org.springframework.beans.factory.support.abstractbeanfactory.istypematch(abstractbeanfactory.java:486) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbeannamesfortype(defaultlistablebeanfactory.java:305) @ org.springframework.beans.factory.beanfactoryutils.beannamesfortypeincludingancestors(beanfactoryutils.java:185) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.findautowirecandidates(defaultlistablebeanfactory.java:810) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:767) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:685) @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredmethodelement.inject(autowiredannotationbeanpostprocessor.java:559) @ org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:84) @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:283) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1055) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:511) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:450) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:290) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:222) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:287) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:189) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:562) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:871) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:423) @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:443) @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:459) @ org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:340) @ org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:307) @ org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:127) @ javax.servlet.genericservlet.init(genericservlet.java:212) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1161) @ org.apache.catalina.core.standardwrapper.allocate(standardwrapper.java:806) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:129) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:128) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:104) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:261) @ org.apache.coyote.http11.http11processor.process(http11processor.java:844) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:581) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447) @ java.lang.thread.run(thread.java:619)     caused by: java.lang.noclassdeffounderror: not initialize class net.sf.cglib.proxy.enhancer @ org.springframework.aop.framework.cglib2aopproxy.createenhancer(cglib2aopproxy.java:228) @ org.springframework.aop.framework.cglib2aopproxy.getproxy(cglib2aopproxy.java:170) @ org.springframework.aop.framework.proxyfactory.getproxy(proxyfactory.java:112) @ org.springframework.aop.scope.scopedproxyfactorybean.setbeanfactory(scopedproxyfactorybean.java:109) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeawaremethods(abstractautowirecapablebeanfactory.java:1422) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1391) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:513) ... 43 more aug 20, 2013 2:51:07 org.apache.catalina.core.standardwrappervalve invoke severe: allocate exception servlet mydispatcherservlet org.springframework.beans.factory.nosuchbeandefinitionexception: no matching bean of type [com.clicktoshop.beans.registerbean] found dependency: expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: {} @ org.springframework.beans.factory.support.defaultlistablebeanfactory.raisenosuchbeandefinitionexception(defaultlistablebeanfactory.java:901) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:770) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:685) @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredmethodelement.inject(autowiredannotationbeanpostprocessor.java:559) @ org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:84) @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:283) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1055) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:511) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:450) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:290) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:222) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:287) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:189) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:562) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:871) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:423) @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:443) @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:459) @ org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:340) @ org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:307) @ org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:127) @ javax.servlet.genericservlet.init(genericservlet.java:212) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1161) @ org.apache.catalina.core.standardwrapper.allocate(standardwrapper.java:806) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:129) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:128) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:104) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:261) @ org.apache.coyote.http11.http11processor.process(http11processor.java:844) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:581) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:447) @ java.lang.thread.run(thread.java:619) 

problem got resolved after replacing spring 3.0 jar spring 3.2.2 jars. there no need add other external jars if using spring 3.2 jars.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -