- 浏览: 939490 次
- 性别:
- 来自: 江西上饶
文章分类
- 全部博客 (460)
- p.spring (56)
- p.maven (20)
- p.ant (17)
- p.jee (18)
- p.jse (33)
- p.ofbiz (31)
- p.软件工程 (8)
- p.struts2 (5)
- p.hibernate (5)
- linux (25)
- 设计模式 (2)
- p.javascript (11)
- 硬件 (1)
- p.jsp (2)
- p.windows批处理 (1)
- 操作系统问题 (5)
- 算法 (1)
- p.mysql (7)
- p.sql (5)
- p.c (1)
- google产品 (0)
- 内存 (1)
- p.struts (1)
- p.freemarker (7)
- p.css (4)
- p.log4j (10)
- p.html (3)
- 淘宝产品 (0)
- 其他 (3)
- 编译器 (0)
- svn (4)
- p.spring.security (11)
- 图形 (0)
- p.xml (1)
- p.ssh (0)
- p.jquery (4)
- p.jdbc (3)
- p.flex (0)
- p.c++ (0)
- p.c#Net (0)
- p.assembly (0)
- p.sqlserver (0)
- p.其他 (3)
- p.webwork (21)
- p.wap (12)
- p.cglib (1)
- p.jee服务器 (11)
- windows (2)
- p.iphone (1)
- p.java.分布式与集群 (2)
- p.ibatis (16)
- p.eclipse (5)
- 架构 (2)
- http协议 (5)
- 我的个人标准 (2)
- 多线程 (1)
- 奇怪问题 (5)
- p.jira (13)
- p.httpclient (1)
- 服务器.apache (11)
- 安全防范 (1)
- p.PODAM (1)
- p.junit (16)
- fop (2)
- 硬盘安装 (1)
- powerdesigner (0)
- 单元测试 (1)
- apache commons (4)
- tomcat+apache集群 (10)
- 各类诡辩 (1)
- 安卓 (8)
- qvod (1)
- java编程基础知识考试考点及答案 (0)
- 工作总结 (4)
- oracle (0)
- spring的util工具 (3)
- json (2)
- maven (3)
- jms (19)
- p.bat (3)
- hadoop (2)
- git (3)
- nginx (1)
- p.移动开发 (1)
- shiro (3)
- 游戏破解 (1)
- react-native (7)
- ios开发 (1)
- webmagic (6)
- socks5 (1)
最新评论
-
weituotian:
说的不好,没人看的
公司系统中的菜单功能和权限功能 -
石不易:
非常详细的注解~
绑定端口和IP,Listen 与VirtualHost指令 -
spring_springmvc:
spring mvc demo教程源代码下载,地址:http: ...
spring mvc -
liyixing1:
PandaDONG 写道谢谢你啊,我已经下下来了,只是还有很多 ...
jira war安装 -
liyixing1:
PandaDONG 写道谢谢你啊,我已经下下来了,只是还有很多 ...
jira war安装
做了一个aop的日志记录器,但是在运行的时候出现了日志信息
服务器运行时间:577375 线程名:[http-8080-2]
日志位置:org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:292)
记录器logger名称:org.springframework.aop.aspectj.AspectJExpressionPointcut
日志等级:DEBUG
发生时间:2011-10-20 20:37:04
日志内容:Couldn't access current invocation - matching with limited context: java.lang.IllegalStateException: No MethodInvocation found: Check that an AOP invocation is in progress, and that the ExposeInvocationInterceptor is in the interceptor chain.
看起来还是调试级别的。不晓得具体原因。去查看源代码
public boolean matches(Method method, Class targetClass, Object[] args) {
checkReadyToMatch();
ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method);
ShadowMatch originalShadowMatch = getShadowMatch(method, method);
// Bind Spring AOP proxy to AspectJ "this" and Spring AOP target to AspectJ target,
// consistent with return of MethodInvocationProceedingJoinPoint
ProxyMethodInvocation pmi = null;
Object targetObject = null;
Object thisObject = null;
try {
//这里抛出的异常。ExposeInvocationInterceptor.currentInvocation();方法是从当前线程取出已经运行中的代理aop调用者。如果不存在,就抛出异常。这里不晓得spring为何设计为异常,而不是return null
MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
targetObject = mi.getThis();
if (!(mi instanceof ProxyMethodInvocation)) {
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
}
pmi = (ProxyMethodInvocation) mi;
thisObject = pmi.getProxy();
}
catch (IllegalStateException ex) {
//从这里的解释大概能看出来如果不存在调用实例,可能就会去生成一个新的实例。
// No current invocation...
// TODO: Should we really proceed here?
logger.debug("Couldn't access current invocation - matching with limited context: " + ex);
}
JoinPointMatch joinPointMatch = shadowMatch.matchesJoinPoint(thisObject, targetObject, args);
/*
* Do a final check to see if any this(TYPE) kind of residue match. For
* this purpose, we use the original method's (proxy method's) shadow to
* ensure that 'this' is correctly checked against. Without this check,
* we get incorrect match on this(TYPE) where TYPE matches the target
* type but not 'this' (as would be the case of JDK dynamic proxies).
* <p>See SPR-2979 for the original bug.
*/
//存在实例就直接使用这个实例来验证。
if (pmi != null) { // there is a current invocation
RuntimeTestWalker originalMethodResidueTest = new RuntimeTestWalker(originalShadowMatch);
if (!originalMethodResidueTest.testThisInstanceOfResidue(thisObject.getClass())) {
return false;
}
}
if (joinPointMatch.matches() && pmi != null) {
bindParameters(pmi, joinPointMatch);
}
//不存在就return joinPointMatch.matches();这个是aspect的实现。用来查找匹配的。如果有匹配的aop方法,就return true。当return true,spring就会调用组合后的处理方法,也就是通过org.aopalliance.intercept.MethodInterceptor来调用,这里的MethodInterceptor就是代理类中加入的新的代码。如果不存在就直接return proceed()了。
return joinPointMatch.matches();
}
服务器运行时间:577375 线程名:[http-8080-2]
日志位置:org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:292)
记录器logger名称:org.springframework.aop.aspectj.AspectJExpressionPointcut
日志等级:DEBUG
发生时间:2011-10-20 20:37:04
日志内容:Couldn't access current invocation - matching with limited context: java.lang.IllegalStateException: No MethodInvocation found: Check that an AOP invocation is in progress, and that the ExposeInvocationInterceptor is in the interceptor chain.
看起来还是调试级别的。不晓得具体原因。去查看源代码
public boolean matches(Method method, Class targetClass, Object[] args) {
checkReadyToMatch();
ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method);
ShadowMatch originalShadowMatch = getShadowMatch(method, method);
// Bind Spring AOP proxy to AspectJ "this" and Spring AOP target to AspectJ target,
// consistent with return of MethodInvocationProceedingJoinPoint
ProxyMethodInvocation pmi = null;
Object targetObject = null;
Object thisObject = null;
try {
//这里抛出的异常。ExposeInvocationInterceptor.currentInvocation();方法是从当前线程取出已经运行中的代理aop调用者。如果不存在,就抛出异常。这里不晓得spring为何设计为异常,而不是return null
MethodInvocation mi = ExposeInvocationInterceptor.currentInvocation();
targetObject = mi.getThis();
if (!(mi instanceof ProxyMethodInvocation)) {
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
}
pmi = (ProxyMethodInvocation) mi;
thisObject = pmi.getProxy();
}
catch (IllegalStateException ex) {
//从这里的解释大概能看出来如果不存在调用实例,可能就会去生成一个新的实例。
// No current invocation...
// TODO: Should we really proceed here?
logger.debug("Couldn't access current invocation - matching with limited context: " + ex);
}
JoinPointMatch joinPointMatch = shadowMatch.matchesJoinPoint(thisObject, targetObject, args);
/*
* Do a final check to see if any this(TYPE) kind of residue match. For
* this purpose, we use the original method's (proxy method's) shadow to
* ensure that 'this' is correctly checked against. Without this check,
* we get incorrect match on this(TYPE) where TYPE matches the target
* type but not 'this' (as would be the case of JDK dynamic proxies).
* <p>See SPR-2979 for the original bug.
*/
//存在实例就直接使用这个实例来验证。
if (pmi != null) { // there is a current invocation
RuntimeTestWalker originalMethodResidueTest = new RuntimeTestWalker(originalShadowMatch);
if (!originalMethodResidueTest.testThisInstanceOfResidue(thisObject.getClass())) {
return false;
}
}
if (joinPointMatch.matches() && pmi != null) {
bindParameters(pmi, joinPointMatch);
}
//不存在就return joinPointMatch.matches();这个是aspect的实现。用来查找匹配的。如果有匹配的aop方法,就return true。当return true,spring就会调用组合后的处理方法,也就是通过org.aopalliance.intercept.MethodInterceptor来调用,这里的MethodInterceptor就是代理类中加入的新的代码。如果不存在就直接return proceed()了。
return joinPointMatch.matches();
}
发表评论
-
Spring 定时任务,cron表达式,@Scheduled cron表达式
2016-04-25 15:48 5266一个cron表达式有至少6 ... -
spring mvc list
2015-12-14 10:28 1246我使用这样无法传入 @requestMapping(" ... -
Unable to locate Spring NamespaceHandler for XML schema namespace
2015-09-23 14:00 2290org.springframework.beans.facto ... -
关于使用s.url jstl的上下文
2015-08-16 13:28 884比如 [@s.url '/'/]index.html?cote ... -
Spring 属性占位符配置器 PropertyPlaceholderConfigurer
2015-08-02 12:43 2047<!-- 属性配置文件读 ... -
FactoryBean接口
2014-09-30 14:05 868实现了FactoryBean接口的bean不是简单的一个bea ... -
国际化之MessageSourceAware和MessageSourceAccessor
2014-01-06 23:13 2820先看接口MessageSourceAware 该接口的注释中 ... -
spring 惯例优先原则
2013-07-22 09:46 1166惯例优先原则(convention over configur ... -
ant path匹配
2013-07-22 09:40 2135spring和ant path实现相关的主要类有两个 org. ... -
springmvc action方法中参数具有@ModelAttribute与不具有的区别
2012-12-14 09:36 4081在springmvc的参数解析中,发现具有@ModelAttr ... -
util包
2012-12-05 13:50 1068spring的util基本上都在springframework ... -
url,请求相关帮助类UrlPathHelper
2012-11-29 11:18 2487org.springframework.web.util.Ur ... -
整站国际化方案
2012-11-28 17:46 1074当前常见的实现方式,主要由两种方案实现 1.通过locale ... -
spring的三种注入方式
2012-11-20 17:30 18291.通过bean的property子元 ... -
spring AnnotationUtils 注解工具
2011-12-08 11:27 1270spring AnnotationUtils 注解工具 -
GenericCollectionTypeResolver,用于获取list或者map等元素的类型
2011-12-07 16:17 1272GenericCollectionTypeResolver,用 ... -
属性编辑器
2011-12-05 18:19 1055我自定义了一个类型,然后设置了一个属性编辑器,注册的class ... -
iframe下面的session问题
2011-12-04 19:52 5270在写iframe完成长连接获取上传状态的时候,有两次请求,一次 ... -
mvc之类的驱动原理
2011-12-01 09:34 1059<mvc:annotation-driven /> ... -
DEBUG -- CLOSE BY CLIENT STACK TRACE
2011-10-20 10:28 27590在单元测试测试环境下主要参数两个错误信息: 1.java.la ...
相关推荐
客户端与服务端的代码 RMI全名叫做 remote method invocation
NULL 博文链接:https://kdisk-sina-com.iteye.com/blog/258942
解决axis2-CodegenWizardPlugin的BUG,java.lang.reflect.InvocationTargetException 带有相关jar 包及相关文件
CL_Invocation.ps1
MyEclipse6.0下axis2插件的安装! 解决java.lang.reflect.InvocationTargetException本人亲自测试,完美使用!
MyEclipse axis2 wsdl java.lang.reflect.invocationtargetexception code gen 大家要注意一定要仔细,这个问题基本上缺少包引起的,而且一定要clean 如果需要axis2插件 以及这个plugins中的包在我的其他资源里面有
odi-sdk-invocation.jar
远程方法调用 -- Remote Method Invocation-
Asynchronous Web Service Invocation with JAX-WS 2.0
主要介绍了JQuery报错"Uncaught TypeError: Illegal invocation"的处理方法,需要的朋友可以参考下
Invocation生命周期,Session生命周期,Server生命周期
主要介绍了Ajax方式上传文件报错"Uncaught TypeError: Illegal invocation",非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
invocation-chain-monitor RPC调用链监控
在apache上下载的axis2的eclipse插件,使用axis2-eclipse-codegen-wizard时,最后老是报InvocationTargetException异常。 现在上传的版本已经修正,和原版功能完全一样
JDK9-JSE- Java Remote Method Invocation API Guide-2
JDK12-java-remote-method-invocation-api-guide
JDK16-java-remote-method-invocation-api-guide
JDK17-java-remote-method-invocation-api-guide