Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » AccessControlException using LTW in a custom classloader with a security manager
AccessControlException using LTW in a custom classloader with a security manager [message #599798] Fri, 20 March 2009 23:47
steve B is currently offline steve BFriend
Messages: 8
Registered: July 2009
Junior Member
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)
at
java.security.AccessControlContext.checkPermission(AccessCon trolContext.java:264)
at
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)

Thanks.
Previous Topic:can't compile anymore pointcut with generic after upgrade
Next Topic:AccessControlException using LTW in a custom classloader with a security manager
Goto Forum:
  


Current Time: Tue Apr 23 09:34:19 GMT 2024

Powered by FUDForum. Page generated in 0.02839 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top