Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » AccessControlException using LTW in a custom classloader with a security manager
AccessControlException using LTW in a custom classloader with a security manager [message #73570] Fri, 20 March 2009 23:47 Go to next message
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.
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 Go to previous message
Eclipse UserFriend
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
list:
http://www.eclipse.org/aspectj/userlists.php


On 20/03/09 4:47 PM, in article
b0a1ec43e1e50206dad6e90a51c7a839$1@www.eclipse.org, "steve"
<stevebread@yahoo.com> wrote:

> 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:2
> 64)
> 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.
>
Re: AccessControlException using LTW in a custom classloader with a security manager [message #599806 is a reply to message #73570] Sat, 21 March 2009 21:27 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 77
Registered: July 2009
Member
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
list:
http://www.eclipse.org/aspectj/userlists.php


On 20/03/09 4:47 PM, in article
b0a1ec43e1e50206dad6e90a51c7a839$1@www.eclipse.org, "steve"
<stevebread@yahoo.com> wrote:

> 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:2
> 64)
> 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:AccessControlException using LTW in a custom classloader with a security manager
Next Topic:cannot install AJDT 1.6.4, org.eclipse.swt [3.4.0.v3448f]
Goto Forum:
  


Current Time: Fri Dec 19 08:45:19 GMT 2014

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

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