• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring AOP HELP needed

 
Phoenix Kilimba
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • 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
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Nathan you star, it worked like a charm!! Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic