spring.aop_exception

来源:互联网 发布:cfosspeed 知乎 编辑:程序博客网 时间:2024/06/02 04:28
AfterThrowingAdviceTest.javapackage spring.aop_exception;import org.aspectj.lang.annotation.AfterThrowing;import org.aspectj.lang.annotation.Aspect;/** * 定义一个切面 *  * @author ZengWenFeng */@Aspectpublic class AfterThrowingAdviceTest{@AfterThrowing(throwing = "ex", pointcut = "execution(* spring.aop_exception.*.*(..))")public void doRecoveryActions(Throwable ex){System.err.println(ex.getMessage());System.err.println(ex.getCause());}}



package spring.aop_exception;import java.io.FileInputStream;import java.io.FileNotFoundException;import org.springframework.stereotype.Component;@Componentpublic class Chinese implements Person{public void divide(){int a = 5 / 0;System.out.println(a);System.out.println("divide执行完成!");}public String sayHello(String name){try{System.out.println("Chinese.sayHello(" + name + ")");new FileInputStream("a.txt");}catch (FileNotFoundException e){System.err.println("Chinese.sayHello(" + name + ") FileNotFoundException :[" + e.getMessage() + "].");}return "Chinese.sayHello(" + name + ") return ";}}


package spring.aop_exception;public interface Person{public String sayHello(String name);public void divide();}


package spring.aop_exception;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;public class TestZengWenFeng{public static void main(String[] args){//BeanFactory factory = new ClassPathXmlApplicationContext("spring/aop2014/aop.xml");//UserManager userManager = (UserManager) factory.getBean("userManager");ApplicationContext ctx = new ClassPathXmlApplicationContext("spring/aop_exception/bean.xml");Person p = (Person) ctx.getBean("chinese");p.sayHello("ZengWenFeng");p.divide();}}



bean.xml

bean<?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:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans                 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd                http://www.springframework.org/schema/context                 http://www.springframework.org/schema/context/spring-context-2.5.xsd                http://www.springframework.org/schema/tx                http://www.springframework.org/schema/tx/spring-tx-2.5.xsd                http://www.springframework.org/schema/aop                http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"><context:component-scan base-package="spring.aop_exception"><context:include-filter type="annotation"expression="org.aspectj.lang.annotation.Aspect" /></context:component-scan><aop:aspectj-autoproxy /></beans>



2017-08-18 13:35:38,773 DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Found Equinox FileLocator for OSGi bundle URL resolution2017-08-18 13:35:38,788  INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@2321ab80: startup date [Fri Aug 18 13:35:38 CST 2017]; root of context hierarchy2017-08-18 13:35:38,835  INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring/aop_exception/bean.xml]2017-08-18 13:35:38,835 DEBUG org.springframework.beans.factory.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]2017-08-18 13:35:38,851 DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas]2017-08-18 13:35:38,851 DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Loaded schema mappings: {http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://activemq.apache.org/schema/core/activemq-core-5.10.0.xsd=activemq.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://cxf.apache.org/schemas/configuration/http-conf.xsd=schemas/configuration/http-conf.xsd, http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd=schemas/xmldsig-core-schema.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.7.0.xsd=activemq.xsd, http://www.w3.org/2006/07/ws-policy.xsd=schemas/ws-policy-200607.xsd, http://cxf.apache.org/schemas/jaxrs.xsd=schemas/jaxrs.xsd, http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd=schemas/configuration/wsrm-manager.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://schemas.xmlsoap.org/ws/2004/08/addressing=schemas/wsdl/addressing.xsd, http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd=activemq.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd=schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://activemq.apache.org/schema/core/activemq-core-5.5.1.xsd=activemq.xsd, http://schemas.xmlsoap.org/wsdl/=schemas/wsdl/wsdl.xsd, http://cxf.apache.org/schemas/bindings/object.xsd=schemas/bindings/object.xsd, http://activemq.apache.org/schema/core=activemq.xsd, http://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.4.2.xsd=activemq.xsd, http://activemq.apache.org/schema/core/activemq-core-5.6.0.xsd=activemq.xsd, http://www.springframework.org/schema/flex/spring-flex-1.0.xsd=org/springframework/flex/config/xml/spring-flex-1.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.0.0.xsd=activemq.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://cxf.apache.org/schemas/configuration/jms.xsd=schemas/configuration/jms.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://cxf.apache.org/schemas/configuration/http-jetty.xsd=schemas/configuration/http-jetty.xsd, http://schemas.xmlsoap.org/wsdl/http/=schemas/wsdl/http.xsd, http://cxf.apache.org/schemas/wsdl/jms.xsd=schemas/wsdl/jms.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd=schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd, http://cxf.apache.org/schemas/configuration/parameterized-types.xsd=schemas/configuration/parameterized-types.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.3.2.xsd=activemq.xsd, http://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd=activemq.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd=schemas/configuration/wsrm-policy.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.4.1.xsd=activemq.xsd, http://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd, http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd=schemas/wsdl/wsdl.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://cxf.apache.org/schemas/ws/addressing.xsd=schemas/ws-addr-conf.xsd, http://activemq.org/config/1.0=activemq.xsd, http://activemq.apache.org/schema/core/activemq-core.xsd=activemq.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://activemq.org/config/1.0/1.0.xsd=activemq.xsd, http://cxf.apache.org/schemas/wsdl/http-conf.xsd=schemas/wsdl/http-conf.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.w3.org/2001/xml.xsd=schemas/xml.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://activemq.apache.org/schema/core/activemq-core-5.3.1.xsd=activemq.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.w3.org/2007/02/ws-policy.xsd=schemas/ws-policy-200702.xsd, http://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.4.0.xsd=activemq.xsd, http://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://cxf.apache.org/schemas/policy.xsd=schemas/policy.xsd, http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd=schemas/ws-policy-200409.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://cxf.apache.org/schemas/configuration/cxf-beans.xsd=schemas/configuration/cxf-beans.xsd, http://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.9.0.xsd=activemq.xsd, http://cxf.apache.org/schemas/core.xsd=schemas/core.xsd, http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd=activemq.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://cxf.apache.org/schemas/configuration/security.xsd=schemas/configuration/security.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://cxf.apache.org/schemas/configuration/soap.xsd=schemas/configuration/soap.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://cxf.apache.org/schemas/jaxws.xsd=schemas/jaxws.xsd, http://cxf.apache.org/schemas/simple.xsd=schemas/simple.xsd, http://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd=activemq.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd=activemq.xsd, http://cxf.apache.org/schemas/configuration/wsrm-manager-types.xsd=schemas/configuration/wsrm-manager-types.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.0.xsd}2017-08-18 13:35:38,866 DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd2017-08-18 13:35:38,882 DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/context/spring-context-2.5.xsd] in classpath: org/springframework/context/config/spring-context-2.5.xsd2017-08-18 13:35:38,898 DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/tool/spring-tool-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-2.5.xsd2017-08-18 13:35:38,898 DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/aop/spring-aop-2.5.xsd] in classpath: org/springframework/aop/config/spring-aop-2.5.xsd2017-08-18 13:35:38,913 DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions2017-08-18 13:35:38,913 DEBUG org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver - Loaded NamespaceHandler mappings: {http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler, http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://activemq.apache.org/schema/core=org.apache.xbean.spring.context.v2.XBeanNamespaceHandler, http://cxf.apache.org/transports/http-jetty/configuration=org.apache.cxf.transport.http_jetty.spring.NamespaceHandler, http://www.w3.org/2006/07/ws-policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler, http://cxf.apache.org/policy=org.apache.cxf.ws.policy.spring.NamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://cxf.apache.org/transports/jms=org.apache.cxf.transport.jms.spring.NamespaceHandler, http://cxf.apache.org/transports/http/configuration=org.apache.cxf.transport.http.spring.NamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://cxf.apache.org/bindings/object=org.apache.cxf.binding.object.spring.NamespaceHandler, http://cxf.apache.org/ws/addressing=org.apache.cxf.ws.addressing.spring.NamespaceHandler, http://cxf.apache.org/clustering=org.apache.cxf.clustering.spring.NamespaceHandler, http://cxf.apache.org/simple=org.apache.cxf.frontend.spring.NamespaceHandler, http://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler, http://cxf.apache.org/core=org.apache.cxf.bus.spring.NamespaceHandler, http://cxf.apache.org/jaxrs=org.apache.cxf.jaxrs.spring.NamespaceHandler, http://cxf.apache.org/binding/coloc=org.apache.cxf.binding.coloc.spring.NamespaceHandler, http://schemas.xmlsoap.org/ws/2004/09/policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler, http://www.w3.org/ns/ws-policy=org.apache.cxf.ws.policy.spring.PolicyNamespaceHandler, http://www.springframework.org/schema/mvc=org.springframework.web.servlet.config.MvcNamespaceHandler, http://cxf.apache.org/ws/rm/manager=org.apache.cxf.ws.rm.spring.NamespaceHandler, http://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler, http://www.springframework.org/schema/flex=org.springframework.flex.config.xml.FlexNamespaceHandler}2017-08-18 13:35:38,944  INFO org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning2017-08-18 13:35:38,944 DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Looking for matching resources in directory tree [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception]2017-08-18 13:35:38,944 DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Searching directory [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception] for files matching pattern [E:/PRJ_J2EE/PrjFlexJava/WebContent/WEB-INF/classes/spring/aop_exception/**/*.class]2017-08-18 13:35:38,960 DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver - Resolved location pattern [classpath*:spring/aop_exception/**/*.class] to resources [file [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception\AfterThrowingAdviceTest.class], file [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception\Chinese.class], file [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception\Person.class], file [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception\TestZengWenFeng.class]]2017-08-18 13:35:38,976 DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: file [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception\AfterThrowingAdviceTest.class]2017-08-18 13:35:38,976 DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: file [E:\PRJ_J2EE\PrjFlexJava\WebContent\WEB-INF\classes\spring\aop_exception\Chinese.class]2017-08-18 13:35:38,991 DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 8 bean definitions from location pattern [spring/aop_exception/bean.xml]2017-08-18 13:35:38,991 DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Bean factory for org.springframework.context.support.ClassPathXmlApplicationContext@2321ab80: org.springframework.beans.factory.support.DefaultListableBeanFactory@30296f76: defining beans [afterThrowingAdviceTest,chinese,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy2017-08-18 13:35:39,007 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'2017-08-18 13:35:39,007 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'2017-08-18 13:35:39,022 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references2017-08-18 13:35:39,022 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' to allow for resolving potential circular references2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor' to allow for resolving potential circular references2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'2017-08-18 13:35:39,054 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator'2017-08-18 13:35:39,069 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.aop.config.internalAutoProxyCreator' to allow for resolving potential circular references2017-08-18 13:35:39,085 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator'2017-08-18 13:35:39,100 DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@680e2291]2017-08-18 13:35:39,100 DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@16a9255c]2017-08-18 13:35:39,100  INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@30296f76: defining beans [afterThrowingAdviceTest,chinese,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy2017-08-18 13:35:39,100 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'afterThrowingAdviceTest'2017-08-18 13:35:39,100 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'afterThrowingAdviceTest'2017-08-18 13:35:39,100 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'afterThrowingAdviceTest' to allow for resolving potential circular references2017-08-18 13:35:39,100 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'afterThrowingAdviceTest'2017-08-18 13:35:39,100 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'chinese'2017-08-18 13:35:39,100 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'chinese'2017-08-18 13:35:39,163 DEBUG org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory - Found AspectJ method: public void spring.aop_exception.AfterThrowingAdviceTest.doRecoveryActions(java.lang.Throwable)2017-08-18 13:35:39,163 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'chinese' to allow for resolving potential circular references2017-08-18 13:35:39,256 DEBUG org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator - Creating implicit proxy for bean 'chinese' with 0 common interceptors and 2 specific interceptors2017-08-18 13:35:39,256 DEBUG org.springframework.aop.framework.JdkDynamicAopProxy - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [spring.aop_exception.Chinese@3adec8b3]2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'chinese'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'2017-08-18 13:35:39,256 DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@5f90a0d6]2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'2017-08-18 13:35:39,256 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'chinese'Chinese.sayHello(ZengWenFeng)Chinese.sayHello(ZengWenFeng) FileNotFoundException :[a.txt (系统找不到指定的文件。)].2017-08-18 13:35:39,272 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'afterThrowingAdviceTest'/ by zeronullException in thread "main" java.lang.ArithmeticException: / by zeroat spring.aop_exception.Chinese.divide(Chinese.java:13)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)at com.sun.proxy.$Proxy6.divide(Unknown Source)at spring.aop_exception.TestZengWenFeng.main(TestZengWenFeng.java:15)