如何在GATE使用CGLIB代理?

时间:2015-03-13 18:40:36

标签: java spring google-app-engine aop cglib

我正在尝试将我的应用配置为在GAE上使用CGLIB代理

根据文件 http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html我在applicationContext.xml中设置了元素的属性proxy-target-class属性为true

<aop:config proxy-target-class="true">
  <aop:advisor advice-ref="advice1" pointcut="execution(* org.somepackage.*.*(..))" />
  <aop:advisor advice-ref="advice1" pointcut="execution(* org.somepackage.someclass.*(..))" />
</aop:config>

但我仍然收到这个错误:

Caused by: java.security.AccessControlException: access denied
    ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.proxy")
    at com.google.appengine.runtime.Request.process-c6d418658e01b411(Request.java)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:382)
    at java.security.AccessController.checkPermission(AccessController.java:572)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at java.lang.Class.forName(Class.java:147)
    at org.aspectj.weaver.reflect.ReflectionBasedReferenceTypeDelegateFactory.createDelegate(ReflectionBasedReferenceTypeDelegateFactory.java:40)
    at org.aspectj.weaver.reflect.ReflectionWorld.resolveDelegate(ReflectionWorld.java:110)
    at org.aspectj.weaver.World.resolveToReferenceType(World.java:378)
    at org.aspectj.weaver.World.resolve(World.java:271)
    at org.aspectj.weaver.World.resolve(World.java:191)
    at org.aspectj.weaver.World.resolve(World.java:338)
    at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:76)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:235)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:195)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:250)

我哪里错了?

0 个答案:

没有答案