完整报错如下:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beforeAdvice' defined in class path resource [applicationContext.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 10
execution()

出现了一种<aop:config>标签与bean无法共存的现象,一开始以为是aspectj 包的版本问题,可修改来修改去,还是报错。

解决方案:后来发现,还是因为excution()内的表达式写错了,修改后运行成功。

    <aop:config>
<aop:aspect id="beforeAspect" ref="beforeAdvice">
<aop:before method="methodBefore" pointcut="execution(* com.ph.service..*.*(..))"/>
</aop:aspect>
</aop:config>

如果排除了版本不匹配、注解没写等问题后,还是报错,就要考虑是不是execution表达式写错了。

Spring AOP 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource..........的更多相关文章

  1. 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]

    报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...

  2. 【报错】org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource

    环境:maven+eclipse+jdk1.8 [tomcat使用的是maven自带的插件,实质原因就是出在tomcat版本问题] 背景:在进行SSM集成WebSocket的时候,项目启动报org.s ...

  3. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [spring/applicationContext-service.xml]: Cannot resolve refer

    <!-- aop --> <aop:config> <aop:pointcut expression="execution(* com.zsn.Service. ...

  4. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is

    在复制xml文件进行修改的时候,我经常将不小心对原文件进行修改,而导致创建bean出错.报错如下所示: Exception sending context initialized event to l ...

  5. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource

    二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.SetAllPropertiesRule begin警告: [SetAllPropertiesRu ...

  6. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource

    spring boot web项目运行时提示如下错误 org.springframework.beans.factory.BeanCreationException: Error creating b ...

  7. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'r ...

  8. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined ...

  9. aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method fai

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleDaoImpl' ...

随机推荐

  1. MyEclipse10.6 myeclipse2013下添加jadClipse反编译插件 .

    jad是一个使用比较广泛的Java反编译软件,jadClipse是jad在eclipse下的插件,下面像大家介绍下如何将jadclipse加入到MyEclipse10.X,9.X,8.X,6.X等各版 ...

  2. 将jpg压缩成webp格式的图片

    cwebp名称 cwebp -压缩图像文件为的WebP文件概要 cwebp [选项] INPUT_FILE -o output_file.webp描述 cwebp压缩使用的WebP格式的图像.输入格式 ...

  3. SAP NetWeaver BPM

    什么是BPM? BPM是Business Process Management的缩写,翻译过来是业务流程管理.BPM本身并没有明确的定义,它更多的是一种概念,这个概念本身的产生来源于企业对众多业务系统 ...

  4. MySQL IFNULL基本用法

    MySQL IFNULL函数是MySQL控制流函数之一,它接受两个参数,如果不是NULL,则返回第一个参数. 否则,IFNULL函数返回第二个参数. 两个参数可以是文字值或表达式. 以下说明了IFNU ...

  5. liunx 安装maven

    cd /usr/local mkdir maven cd /usr/local/maven wget https://archive.apache.org/dist/maven/maven-3/3.1 ...

  6. ZOJ 3212 K-Nice(满足某个要求的矩阵构造)

    H - K-Nice Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Sta ...

  7. CSU 2056 a simple game (正反进行KMP)超级好题!!!

    Description 这一天,小A和小B在玩一个游戏,他俩每人都有一个整数,然后两人轮流对他们的整数进行操作,每次在下列两个操作任选一个: (1)对整数进行翻转,如1234翻转成4321 ,1200 ...

  8. Notes 20180508 : Java基本程序设计结构之关键字与标识符

    我们成功书写了HelloWorld后,又深入了解了main函数,提到过main并非是关键字,可什么又是关键字呢?这其实就是这章要研究的内容,本节研究关键字与标识符,在标识符中我们也会讲解一下Java中 ...

  9. 让你的QT显示一个窗口吧

    项目文件 01_QtTest.pro #------------------------------------------------- # # Project created by QtCreat ...

  10. 实现一个自定义event事件,包括on ,off,trigger,once

    on监听事件,off取消事件 ,trigger触发事件,once只执行一次 class Event { constructor() { this.handlers = {};//记录所有的事件以及处理 ...