Spring 3.0 / AOP / Aspectj:autoproxy intercept any call to getConnection()

故事扮演 提交于 2019-12-01 08:53:15

Yes, I have an idea: Actually your pointcuts match the desired calls, but they are in the java package which (like the javax package) is excluded from weaving by default.

There is a way to remove that restriction via command line and aop.xml, but please be aware of potential problems concerning classloading. You have to make sure the classloader loading the java classes has a weaver attached, so if you have the option not to use LTW, just weave the JDK class files and use those woven classes, and you will be fine. Otherwise you might have a "hen and egg" problem.

Check whether you have added the below tag in your xml file.

aop:aspectj-autoproxy

Also check whether you have added the bean definition inside the xml for this ConnectionAspect class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!