| 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!
|
 |
 |
|
|
subject: Spring AOP HELP needed
|
|
|