SunScreenCert
asked on
spring error - very mysterious
i am creating a spring project with AOP features. I am getting this error. And the same thing created on somebody else's computer, there is no error
Exception in thread "main" org.springframework.beans. factory.Be anCreation Exception: Error creating bean with name 'aopTest' defined in class path resource [context.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodErro r: org.objectweb.asm.ClassWri ter.<init> (I)V
at org.springframework.beans. factory.su pport.Abst ractAutowi reCapableB eanFactory .doCreateB ean(Abstra ctAutowire CapableBea nFactory.j ava:547)
at org.springframework.beans. factory.su pport.Abst ractAutowi reCapableB eanFactory $1.run(Abs tractAutow ireCapable BeanFactor y.java:485 )
at java.security.AccessContro ller.doPri vileged(Na tive Method)
at org.springframework.beans. factory.su pport.Abst ractAutowi reCapableB eanFactory .createBea n(Abstract AutowireCa pableBeanF actory.jav a:455)
at org.springframework.beans. factory.su pport.Abst ractBeanFa ctory$1.ge tObject(Ab stractBean Factory.ja va:251)
at org.springframework.beans. factory.su pport.Defa ultSinglet onBeanRegi stry.getSi ngleton(De faultSingl etonBeanRe gistry.jav a:169)
at org.springframework.beans. factory.su pport.Abst ractBeanFa ctory.getB ean(Abstra ctBeanFact ory.java:2 48)
at org.springframework.beans. factory.su pport.Abst ractBeanFa ctory.getB ean(Abstra ctBeanFact ory.java:1 70)
at org.springframework.beans. factory.su pport.Defa ultListabl eBeanFacto ry.preInst antiateSin gletons(De faultLista bleBeanFac tory.java: 413)
at org.springframework.contex t.support. AbstractAp plicationC ontext.fin ishBeanFac toryInitia lization(A bstractApp licationCo ntext.java :735)
at org.springframework.contex t.support. AbstractAp plicationC ontext.ref resh(Abstr actApplica tionContex t.java:369 )
at org.springframework.contex t.support. ClassPathX mlApplicat ionContext .<init>(Cl assPathXml Applicatio nContext.j ava:180)
at org.springframework.contex t.support. ClassPathX mlApplicat ionContext .<init>(Cl assPathXml Applicatio nContext.j ava:155)
at org.springframework.contex t.support. ClassPathX mlApplicat ionContext .<init>(Cl assPathXml Applicatio nContext.j ava:141)
at spring.aop.Main.main(Main. java:18)
Caused by: java.lang.NoSuchMethodErro r: org.objectweb.asm.ClassWri ter.<init> (I)V
at net.sf.cglib.core.Debuggin gClassWrit er.<init>( DebuggingC lassWriter .java:47)
at net.sf.cglib.core.DefaultG eneratorSt rategy.get ClassWrite r(DefaultG eneratorSt rategy.jav a:30)
at net.sf.cglib.core.DefaultG eneratorSt rategy.gen erate(Defa ultGenerat orStrategy .java:24)
at net.sf.cglib.core.Abstract ClassGener ator.creat e(Abstract ClassGener ator.java: 216)
at net.sf.cglib.core.KeyFacto ry$Generat or.create( KeyFactory .java:144)
at net.sf.cglib.core.KeyFacto ry.create( KeyFactory .java:116)
at net.sf.cglib.core.KeyFacto ry.create( KeyFactory .java:108)
Exception in thread "main" org.springframework.beans.
at org.springframework.beans.
at org.springframework.beans.
at java.security.AccessContro
at org.springframework.beans.
at org.springframework.beans.
at org.springframework.beans.
at org.springframework.beans.
at org.springframework.beans.
at org.springframework.beans.
at org.springframework.contex
at org.springframework.contex
at org.springframework.contex
at org.springframework.contex
at org.springframework.contex
at spring.aop.Main.main(Main.
Caused by: java.lang.NoSuchMethodErro
at net.sf.cglib.core.Debuggin
at net.sf.cglib.core.DefaultG
at net.sf.cglib.core.DefaultG
at net.sf.cglib.core.Abstract
at net.sf.cglib.core.KeyFacto
at net.sf.cglib.core.KeyFacto
at net.sf.cglib.core.KeyFacto
looks like the objectweb jar is not available
ASKER
it is there i reconfirmed it....
ASKER
ok if i change a line in context.xml as
<context:annotation-config />
<!--aop:aspectj-autoproxy/ -->
<aop:aspectj-autoproxy>
<aop:include name="aopTest"/>
</aop:aspectj-autoproxy>
<bean id="aopTest" name="alias1 alias2" class="spring.aop.AopTest" />
<bean id="aspectBean" class="spring.aop.BeforeEx ample"/>
it then compiles successfully but none of the advice are executed
<context:annotation-config
<!--aop:aspectj-autoproxy/
<aop:aspectj-autoproxy>
<aop:include name="aopTest"/>
</aop:aspectj-autoproxy>
<bean id="aopTest" name="alias1 alias2" class="spring.aop.AopTest"
<bean id="aspectBean" class="spring.aop.BeforeEx
it then compiles successfully but none of the advice are executed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.