aop郁闷错误

很郁闷的错误,终于解决了:

<aop:config>
  <aop:aspect ref="log">
   <aop:pointcut id="aopTest" expression="execution(*com.gc.action.HelloWorldActionDAO.*(..))"/>
   <aop:around method="around" pointcut-ref="aopTest"/>
  </aop:aspect>
 </aop:config>

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘urlMapping‘ defined in ServletContext resource [/WEB-INF/spring-servlet.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‘: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [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 47
execution(*com.gc.action.HelloWorldActionDAO.*(..))
                                               ^

修改:

<aop:config>
  <aop:aspect ref="log">
   <aop:pointcut id="aopTest" expression="execution(* com.gc.action.HelloWorldActionDAO.*(..))"/>
   <aop:around method="around" pointcut-ref="aopTest"/>
  </aop:aspect>
</aop:config>

在*后面加一个空格,则解决问题,不错不知道啊,望大家能注意啊。

时间: 2024-08-14 12:01:52

aop郁闷错误的相关文章

Spring AOP常见错误解析

Spring 3.0以后的版本相比于2时代的版本一个重要的变化就是aop所依赖的jar包没有一起发布,需要自己单独下载. Spring AOP部分使用JDK动态代理或者CGLIB来为目标对象创建代理.如果被代理的目标实现了至少一个接口,则会使用JDK动态代理,如果用JDK动态代理,就必须为被代理的目标实现一个接口(要注意的地方是:需要将ctx.getBean()方法的返回值用接口类型接收):.所有该目标类型实现的接口都将被代理.若该目标对象没有实现任何接口,则创建一个CGLIB代理,如果使用CG

Spring Boot 乐观锁加锁失败 - 使用AOP恢复错误

之前写了一些辅助工作相关的Spring Boot怎么使用AOP.这里继续正题,怎么减少Spring Boot 乐观锁加锁报错的情况(基本可以解决). 1. 包依赖 spring-boot-starter-data-jpa, Spring Boot的JPA starter h2, H2内存数据库 spring-boot-starter-test,Spring Boot的Junit测试starter 1 <dependency> 2 <groupId>org.springframewo

Spring AOP annotation 错误

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error

php连接Access数据库错误及解决方法

<?php $connstr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("data.mdb"); $connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC); $issuetime=date("Y-m-d H:i:s"); $sql="insert into test

实现UDP高效接收/响应

环境Linux g++6.3.0 问题一:一个ip地址如何接收高并发请求 问题二:如何高并发响应消息 发送请求端只能通过ip地址+端口号向服务器发送请求码,所以服务器只能用一个UDP去绑定此ip以及端口号.而如何完成高并发发送响应消息, 谁去发送这个响应消息,接收请求信息的UDP?这就造成其中一个任务必须等待另一个任务执行完毕,sendto是非阻塞,而recvfrom是阻塞,若 执行recvfrom碰巧没有下个请求信息或者网络阻塞造成UDP丢失,那么sendto岂是不能执行(一直等待recvfr

SpringMVC集成AOP错误:java lang classnotfoundexception org aspectj lang joinpoint

记录自己出现的问题,Spring AOP 使用测试类测试没问题,在SpringMVC启动服务器时出现java lang classnotfoundexception org aspectj lang joinpoint错误,开始以为是包错误,最后发现是因为IDEA配置问题导致.把右侧未添加的包双击移到左边,重新启动服务器,启动正常.

Spring AOP报错处理 Can not set field to $Proxy 在spring中使用事物或AOP遇到的错误

[转] 解决方法: http://forum.springsource.org/showthread.php?85016-IllegalArgumentException-with-ApplicationContextAware-Proxy 在配置文件中加入proxy-target-class="true" <tx:annotation-driven transaction-manager="transactionManager" proxy-target-c

郁闷的错误

“/”应用程序中的服务器错误. 编译错误 说明: 在编译向该请求提供服务所需资源的过程中出现错误.请检查下列特定错误详细信息并适当地修改源代码. 编译器错误消息: CS0103: 当前上下文中不存在名称“model” 源错误:

java错误-The prefix &quot;aop&quot; for element &quot;aop:aspectj-autoproxy&quot; is not bound.

配置springmvc的aop时出错: 当我向配置文件中添加:<aop:aspectj-autoproxy proxy-target-class="true"/> 时出错: The prefix "aop" for element "aop:aspectj-autoproxy" is not bound. org.springframework.beans.factory.xml.XmlBeanDefinitionStoreExcep