Spring MVC项目编译警告

时间:2012-08-07 14:27:53

标签: spring-mvc compiler-warnings

所有内容都会编译,但会显示以下警告:

Warning: advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]

Warning: advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]

Warning: advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]

Warning: advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]

有人可以解释它们究竟是什么意思吗?

1 个答案:

答案 0 :(得分:4)

这是编译时AspectJ编织过程的输出 - 它显示了您的代码库中尚未应用哪些AspectJ建议。

为了进一步扩展这一点 - Spring相关方面通常在spring-aspects.jar文件中的META-INF/aop.xml文件中定义,并且这些方面根据您的匹配中的切入点编织到您的类中代码库,如果某些切入点不匹配,例如,您可能在任何地方都没有任何@Async注释,那么建议不会被应用,您会看到advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied