This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice

 
avneesh atri
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am running a spring 3 framework program for aspect oriented programing . But it is throwing the following exception. please help.





Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-idol-introductions.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefi
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
avneesh atri wrote:java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice


You've missing the aspectj Jar ....

I pretty certain the same question has been asked before.

Hint : Try searching the ranch with java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice

Update
Found it - http://www.coderanch.com/t/565157/Spring/Spring-AOP#2566364
For some strange reason searching for java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice does not return any results (including this post) but searching for java.lang.NoClassDefFoundError: got me to the above link.
 
avneesh atri
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i read the posts on the link suggested by you . There they are asking to add aopalliance-1.0.jar and aspectjweaver.jar file in the library.I have added the following jar in my library for Aspect oriented programing. But still i am getting an error.

jar file names
aopalliance-1.0.jar
aspectjrt-1.5.jar
springaop-3.0.2-Release.jar
aspectjweaver-1.5.4.jar

the error i am getting is

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eddie' defined in class path resource [spring-idol-introductions.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 59
execution(*com.springinaction.springidol.Performer.perform(..))
^
please help i am stuck
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need a space between the * and com in your pointcut expression
 
avneesh atri
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much ................... it worked
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic