frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

ClassLoader.getSystemClassLoader() permission might not be available #336

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In certain secure containers, it's illegal to call this method. We need to wrap 
this in a try/catch block 
and handle the potential SecurityException if it happens.

Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader)
       at java.security.AccessControlContext.checkPermission(Unknown Source)
       at java.security.AccessController.checkPermission(Unknown Source)
       at java.lang.SecurityManager.checkPermission(Unknown Source)
       at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
       at com.google.inject.internal.BytecodeGen.getClassLoader(BytecodeGen.java:123)
       at com.google.inject.internal.BytecodeGen.getClassLoader(BytecodeGen.java:116)
       at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:143)

Original issue reported on code.google.com by limpbizkit on 14 Feb 2009 at 5:16

GoogleCodeExporter commented 9 years ago
perhaps also wrap it inside a doPrivileged block?

Original comment by mccu...@gmail.com on 22 Feb 2009 at 8:02

GoogleCodeExporter commented 9 years ago
I started into this wtih r873. I haven't been able to verify yet.

Original comment by limpbizkit on 11 Mar 2009 at 4:59

GoogleCodeExporter commented 9 years ago
Verified fixed.

Original comment by limpbizkit on 11 Mar 2009 at 9:20