In our last episode, I was using the pointcut expression
and getting this error:
java.lang.IllegalArgumentException: warning no match for this type name: com.example [Xlint:invalidAbsoluteTypeName]
I Googled this error (alas, my beloved Ask.com seems to have fewer of the stack trace errors indexed) and found a post to a Spring Framework support forum saying it was the pointcut expression that was incorrect. And in The AspectJTM Programming Guide under Matching and Some Example Pointcuts it does look like there’s supposed to be a method signature there in the pointcut expression, not just a class name.
Now that I understand the pointcut expressions a little more, I think I’ll take out most of the wildcards for now (I’m leaving the “..” wildcard for the Message parameter for now because when I replaced that with Message, I got some kind of error):
<aop:config> <aop:pointcut id="stuff" expression="execution(void com.example.MessageListener.onMessage(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="stuff" /> </aop:config>
Now the deployment succeeds… but when my messagelistener throws a RuntimeException the message is still gone from the queue, so it doesn’t seem to be rolling back correctly yet. So that’s where we’ll start next time!