|Re: AccessControlException using LTW in a custom classloader with a security manager [message #73589 is a reply to message #73570]
||Sat, 21 March 2009 21:27
Originally posted by: andrew.eisenberg.springsource.com|
1.5.4 is a very old version of AspectJ. Try upgrading to 1.6.3 or later.
Not sure if this will work, but that is the first thing I'd try. If you
continue to have problems, send a message to the AspectJ user's mailing
On 20/03/09 4:47 PM, in article
> Hi, I am using LTW in a custom classloader. The application is running
> under a security manager which gives AllPermissions to aspectj but
> restricted permissions to the classes defined by the custom classloader
> i.e. the classes loaded by the custom classloader are in a sandbox.
> When instantiating a sandboxed class, I receive an AccessControlException
> because aspectj is performing an operation for which the sandboxed class
> (which is also on the stack) does not have permission.
> I don't want to hack the aspectj code to wrap calls to Class/ClassLoader
> in doPrivileged. Is there another way to make this work?
> I am using aspectj 1.5.4
> Stack trace:
> Caused by: java.security.AccessControlException: access denied
> (java.lang.RuntimePermission getClassLoader)
> java.security.AccessControlContext.checkPermission(AccessCon trolContext.java:2
> java.security.AccessController.checkPermission(AccessControl ler.java:427)
> at java.lang.SecurityManager.checkPermission(SecurityManager.ja va:532)
> at java.lang.Class.getClassLoader(Class.java:588)
> at org.aspectj.runtime.reflect.Factory.<init>(Factory.java:71)
> at MySandboxedClass.<clinit>(MySandboxedClass.java:1)
Powered by FUDForum
. Page generated in 0.02827 seconds