This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring AOP HELP needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring AOP HELP needed" Watch "Spring AOP HELP needed" New topic
Author

Spring AOP HELP needed

Phoenix Kilimba
Ranch Hand

Joined: Oct 10, 2006
Posts: 64
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


You are what you know
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

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'.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Phoenix Kilimba
Ranch Hand

Joined: Oct 10, 2006
Posts: 64
Nathan you star, it worked like a charm!! Thanks!
 
Don't get me started about those stupid light bulbs.
 
subject: Spring AOP HELP needed
 
Similar Threads
AOP logging throws exception
Problem with Spring AOP
Spring AOP issue
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'id' is defined
Spring 2.5 and AOP - BeanPostProcessor before instantiation of bean failed