Aop error using Simon

67 views
Skip to first unread message

Idan Fridman

unread,
Aug 13, 2013, 3:45:34 AM8/13/13
to java...@googlegroups.com
Hi,
I am trying to declare packages using the AOP way(instead of @Monitored every class) in my Spring project.

I took the example and modify if that way:

 <bean id="monitoringInterceptor" class="org.javasimon.spring.MonitoringInterceptor"/>

        <aop:config>
                <!-- name of the class or interface -->
                <aop:pointcut id="monitoringPointcut" expression="execution(* com.myexample.*(..))"/>
                <aop:advisor advice-ref="monitoringInterceptor" pointcut-ref="monitoringPointcut"/>
        </aop:config>


and I got this exception:

Caused by: java.lang.IllegalArgumentException: warning no match for this type name: com.myexample [Xlint:invalidAbsoluteTypeName]
at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:301)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:208)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:194)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:183)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:164)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
... 60 more


What Am I missing here?

thanks,
ray.

Richard Richter

unread,
Aug 13, 2013, 3:56:30 AM8/13/13
to java...@googlegroups.com
Hi

This seems to be Spring/AOP configuration problem... doesn't it just
mean that no match was found? At least that what seems to be in the
message. Have you replaced com.myexample with your actual packages?
They also have to match some component I guess. This is a real example
from our current project:

<aop:pointcut id="monitoringPointcut" expression="execution(*
sk.posam.cruz.service..*Impl.*(..))"/>

Any class that ends with Impl and is in any subpackage of
sk.posam.cruz.service, and on these any method will be monitored.

Cheers

Virgo
> --
> You received this message because you are subscribed to the Google Groups
> "javasimon" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to javasimon+...@googlegroups.com.
> To post to this group, send email to java...@googlegroups.com.
> Visit this group at http://groups.google.com/group/javasimon.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Idan Fridman

unread,
Aug 13, 2013, 4:02:23 AM8/13/13
to java...@googlegroups.com
Fixed by fixing the aop point-cut
Reply all
Reply to author
Forward
0 new messages