Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Pointcut methods

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys!!
I'm learning spring aop and I have problems with the @Pointcut().

What I want is to print out this results based in the Aspect Class. Print The get methods of the Circle or Triangle and the ShapeService class

*********************************
Advice run. Get Method called
Second Advice executed
Advice run. Get Method called
Second Advice executed
Triangle Name or Circle Name
*********************************

This is the error

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'triangle' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut allGetters

This is the Aspect Class




this is the Shape Service


The Circle class



The Triangle class


the spring.xml


an the main class


So the question is what is the problem???
I search in the internet similiar problems of referenced pointcut allGetters and they said: "it was the .jars
aspectjrt-1.6.12.jar and aspectjweaver-1.6.12.jar change to 1.5 and the AspectJ has a bug.

I have this jars in the project and I'm using Spring 3.0.5

aopalliance.jar
cglib-2.2.2.jar
asm-3.3.1.jar
aspectjrt-1.5.4.jar
aspectjweaver-1.5.4.jar

thanks for the help
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alen,

I just ran your piece of code and everything ran fine except some minor errors ( Config has mentioned package structure for classes but actual class doesn't have the package information).
Apart from this minor error, Application ran fine. As you have correctly mentioned, there might be some issues with aopalliance jars. I have listed down my version of jars, perhaps this might be of some help.
Spring Jars version 3.1
aspectjrt.jar : Manifest file suggests version is 1.6
aopalliance-1.0.jar
asm-all-4.0_RC1.jar
aspectj-1.6.12.jar
aspectjtools.jar : Manifest file suggests version is 1.6.12
aspectjweaver.jar : Manifest file suggests version is 1.6.12
cglib-2.2.2.jar
org.aspectj.matcher.jar : Manifest file suggests version is 1.6.12


Thanks

 
Alen Mester
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks my friend. finally work!!!

this topic is closed XD
 
    Bookmark Topic Watch Topic
  • New Topic