wood burning stoves
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 Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring AOP HELP needed" Watch "Spring AOP HELP needed" New topic

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:





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

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

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!
I agree. Here's the link: http://aspose.com/file-tools
subject: Spring AOP HELP needed
It's not a secret anymore!