完整报错如下:

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. python SQLAlchemy复习

    下面的代码主要使用SQLAlchemy的ORM思想实现查询单词的功能: 实现输入一个单词,查询出与输入单词接近的单词以及单词的意思. 主要有以下三步: 1.创建数据表 2.插入数据 3.查询数据 1. ...

  2. 学习python第三天数据库day2

    day01回顾: 数据库: 定义:存储数据的仓库(database,简称db) 常用的数据库对象有哪些? 1).数据表(table) ***** 2).视图(view) 3).索引(index) 4) ...

  3. 最简单的方式在linux上升级node.js版本

    node的升级频率太高,n模块来升级是最方便的,网上看了很多资料介绍使用n模块,但是安装n模块之后却经常找不到这个命令  很多同学安装之后直接去使用n会发现命令不存在,就停留在这一步无法前进了. 解决 ...

  4. A NB群友 【记忆化搜索】(2019年华南理工大学程序设计竞赛(春季赛))

    冲鸭!去刷题:https://ac.nowcoder.com/acm/contest/625/A 题目描述 CC是著名的算法竞赛选手,他不仅人长得帅,而且技术了得,自然而然就有了许多粉丝. 为了能帮助 ...

  5. Python自动化之traceback

    import traceback try: 11/a except Exception: b = traceback.format_exc() traceback.format_exc()会存储详细的 ...

  6. 从公司服务器C盘被删说起

    事情起因 一个阳(严)光(重)明(雾)媚(霾)的周二,对于我们从周二到周六的班次来说,这是新的一周开始.我像往常一样,打开电脑,倒上一杯水,开始翻阅从大洋彼岸发来的各种邮件.突然看到一封紧急的邮件,内 ...

  7. C++垃圾回收器的实现

    一.简单介绍 这是一个自己写C++垃圾自己主动回收器,用到的都是标准C++语法.採用了引用计数加mark-sweep的方法.在没有循环引用的情况下,引用计数能够保证垃圾实时得到回收:对于有循环引用的情 ...

  8. block本质探寻六之修改变量

    说明: <1>阅读本文章,请参照前面的block文章加以理解: <2>本文的变量指的是auto类型的局部变量(包括实例对象): <3>ARC和MRC两种模式均适用: ...

  9. iOS开发网络篇—发送GET和POST请求(使用NSURLSession) - 转

    说明: 1.该文主要介绍如何使用NSURLSession来发送GET请求和POST请求 2.本文将不再讲解NSURLConnection的使用,如有需要了解NSURLConnection如何发送请求. ...

  10. 【OS X系统】Xcode中搭建Python环境。

    虽然按照网上教程一步一步来,但还是遇到了几个错误点,现整理出来,主要是自己做个笔记,同时也希望能帮助到其他像我一样第一次在Xcode上搭建Python环境的人.首先感谢原作者:https://zhid ...