lishunli / nutz

Automatically exported from code.google.com/p/nutz
0 stars 0 forks source link

Aop在GAE上工作不正常 #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
版本: rev576

本地测试                Pass
GAE Junit               Pass 
GAE 本地服务器测试      Fail

原本预计只有几个预期的fail,结果大部分Aop测试fail.都fail在同
一个地方:
Aop增强klass后,生成的实例,转换为超类引用时,报: ClassCast
无论使用Mirror.me.born(),还是直接newInstance,或者通过获取特定构
造方法后创建
实例,赋值给超类变量时均报错!
例如:
Class<Aop1> newClass = classAgent.define(Aop1.class);
Mirror<Aop1> mirror = Mirror.me(newClass);
Aop1 obj = mirror.born("Nutz"); //报错!
Aop1 a1 = newClass.getConstructor(String.class).newInstance("Nutz"); //报错!
然而,调用:
System.out.println(obj.getClass().getSuperclass());
打印的却是正确无误的: class org.nutz.aop.asm.test.Aop1

非常神奇,创建对象不会出任何错误,赋值时才报错!
Asm 3.x 都换过了.

不敢肯定是否为GAE的Bug

Original issue reported on code.google.com by wendal1985@gmail.com on 11 Dec 2009 at 5:29

GoogleCodeExporter commented 9 years ago
用 Javassist 写个简单的 Main 函数,会不会也报同样的错误呢?

Original comment by zozoh...@gmail.com on 11 Dec 2009 at 8:03

GoogleCodeExporter commented 9 years ago

Original comment by zozoh...@gmail.com on 11 Dec 2009 at 8:10

GoogleCodeExporter commented 9 years ago
换到 ASM 的实现后,这个问题还会重现吗?

Original comment by zozoh...@gmail.com on 14 Dec 2009 at 10:41

GoogleCodeExporter commented 9 years ago
事实证明, 是GAE的问题. 我换上1.3.0的 GAE SDK后, 就一切正常了!

Original comment by wendal1985@gmail.com on 15 Dec 2009 at 9:04

GoogleCodeExporter commented 9 years ago
嗯,需要在 Releat_note 上加一个说明,这个 issue 我加上 FAQ 了 

Original comment by zozoh...@gmail.com on 15 Dec 2009 at 9:07

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 7 Jan 2010 at 11:48

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 7 Jan 2010 at 11:53

GoogleCodeExporter commented 9 years ago
Verified in 1.a.26(r790)

Original comment by wendal1985@gmail.com on 7 Jan 2010 at 11:55

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 13 May 2010 at 10:54