日期:2014-05-19  浏览次数:20805 次

Spring错误:Pointcut is malformed: error at ::0 formal unbound in
使用基于XML方式的切面和切入点的配值的时候提示错误。配置文件内容如下:
<bean id="personService" class="com.service.impl.PersonServiceBean"></bean>
<bean id="myInterceptorForXML" class="com.service.MyInterceptorForXML"></bean>

<aop:config>
  <aop:aspect id="myAOP" ref="myInterceptorForXML">
  <aop:pointcut expression="execution (* com.service.impl.PersonServiceBean.*(..))" id="myCut"/>
  <aop:before pointcut-ref="myCut" method="doAccessCheck"/>
  </aop:aspect>
</aop:config>

提示的错误:Pointcut is malformed: error at ::0 formal unbound in pointcut

希望各位大侠帮帮忙。谢谢

AOP的命名空间和schema也引入了

------解决方案--------------------
看看这个能不能解决你的问题:
http://blog.csdn.net/llbupt/article/details/6611901
------解决方案--------------------
LZ配置文件的上面必须的命名空间是否引入了?

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schem...ng-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">

------解决方案--------------------
可能是这样:
你的切面MyInterceptorForXML,doAccessCheck方法有定义参数。而定参数后, 
<aop:pointcut expression="execution (* com.service.impl.PersonServiceBean.*(..))" id="myCut"/>
这里也要传参,改成如下形式:expression="execution (* com.service.impl.PersonServiceBean.*(..)) and args()" 

args()中写入要传入的参数。