• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Spring AOP HELP needed

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sirs et Madames,
I am brand new to Spring AOP (well spring in general actually) and am trying out a small application to cement my understanding so far. However am running into exceptions which I cannot figure out and was hoping someone out there can help. I have the following source code:

Foo.java


FooService.java


FooServiceImpl.java



SimpleProfiler.java


and Main.java:


and finally, here is applicationContext.xml:


However, when I run Main.java, i get the exception/s:


I don't have the slightest clue where to start tackling this issue, could anyone out there please help?
Thanks in advance
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exception says -

warning no match for this type name: FooService [Xlint:invalidAbsoluteTypeName]



In both of your pointcuts, you've declared the expression like this -

expression="execution(* FooService.*(..))"/>
expression="execution(* FooService.getBefore(String)) and args(myName)"/>



You don't show any package declaration in your classes - however, in the config it appears that some of these classes are in the 'aop' package -

<bean id="fooService" class="aop.FooServiceImpl"/>



I'm betting the FooService interface is also in the aop package - you'll need to change the values in the pointcut expressions from 'FooService' to 'aop.FooService'.
 
Phoenix Kilimba
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nathan you star, it worked like a charm!! Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic