Link to home
Start Free TrialLog in
Avatar of SunScreenCert
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.BeanCreationException: Error creating bean with name 'aopTest' defined in class path resource [context.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:180)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:155)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:141)
        at spring.aop.Main.main(Main.java:18)
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
        at net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47)
        at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
Avatar of Mick Barry
Mick Barry
Flag of Australia image

looks like the objectweb jar is not available
Avatar of SunScreenCert
SunScreenCert

ASKER

it is there i reconfirmed it....
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.BeforeExample"/>

it then compiles successfully but none of the advice are executed
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial