坑之Pointcut is not well-formed: expecting 'name pattern' at character position异常
2017-09-28 09:58
661 查看
配置aop报错:原因是配置切点表达式的时候报错了:
切点表达式配置方法:
切入点表达式的使用规则:execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?)有“?”号的部分表示可省略的,modifers-pattern表示修饰符如public、protected等,ret-type-pattern表示方法返回类型,declaring-type-pattern代表特定的类,name-pattern代表方法名称,param-pattern表示参数,throws-pattern表示抛出的异常。在切入点表达式中,可以使用*来代表任意字符,用..来表示任意个参数。
<aop:config proxy-target-class="false">
<aop:aspect ref="corletPointCutTest">
<aop:pointcut id="allRenderProcess"
expression="execution(*
com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.doRenderService(..)) || execution(* com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.processRenderRequest(..))||execution(*
com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.doActionService(..))" />
<aop:before method="checkPorletPoint" pointcut-ref="allRenderProcess"/>
</aop:aspect>
</aop:config>
注意星号后面要有个空格,一定要有空格,要空格,空格!!!!!
切点表达式配置方法:
切入点表达式的使用规则:execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?)有“?”号的部分表示可省略的,modifers-pattern表示修饰符如public、protected等,ret-type-pattern表示方法返回类型,declaring-type-pattern代表特定的类,name-pattern代表方法名称,param-pattern表示参数,throws-pattern表示抛出的异常。在切入点表达式中,可以使用*来代表任意字符,用..来表示任意个参数。
<aop:config proxy-target-class="false">
<aop:aspect ref="corletPointCutTest">
<aop:pointcut id="allRenderProcess"
expression="execution(*
com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.doRenderService(..)) || execution(* com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.processRenderRequest(..))||execution(*
com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.doActionService(..))" />
<aop:before method="checkPorletPoint" pointcut-ref="allRenderProcess"/>
</aop:aspect>
</aop:config>
<aop:config> <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.taotao.content.service.*.*(..))" /> </aop:config>
注意星号后面要有个空格,一定要有空格,要空格,空格!!!!!
相关文章推荐
- Pointcut is not well-formed: expecting 'name pattern' at character position
- Pointcut is not well-formed: expecting 'name pattern' at character position
- Pointcut is not well-formed: expecting 'name pattern' at character position
- java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ‘name pattern’
- java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ‘name pattern’
- 配置aop报错: Pointcut is not well-formed: expecting 'name pattern' at character position
- Pointcut is not well-formed: expecting 'name pattern' at character position 36
- Pointcut is not well-formed: expecting 'name pattern' at character position
- Pointcut is not well-formed: expecting 'name pattern' at character position
- Pointcut is not well-formed: expecting '(' at character position 0 anyMethod
- Pointcut is not well-formed: expecting 'name pattern' at character position
- java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting '(' at character position
- Pointcut is malformed: Pointcut is not well-formed: expecting 'name pattern' at character position 5
- Pointcut is not well-formed: expecting 'name pattern' at character position
- Error:Pointcut is malformed: Pointcut is not well-formed: expecting '(' at character position 0
- java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at charac
- Pointcut is not well-formed: expecting 'name pattern' at character position 36
- spring aop 报错Pointcut is not well-formed: expecting ‘name pattern’ at character position 48 executi
- Spring AOP 错误:Pointcut is malformed: Pointcut is not well-formed
- Spring3.x错误--Pointcut is not well-formed:expecting 'name pattern' at...