java.security.AccessControlException when running fresh Rails App with Google App Engine Dev Server

145 views Asked by At
I'm trying to run a fresh JRuby Rails app using the Google App Engine devserver, but keep getting this Runtime Permission error. I'm guessing it has something to do with my local java environment, but not sure.

Local Setup: Mac OSX Mavericks, Java 7, JRuby 1.7.6 running in 2.0.0 compatibility mode.

Here's the full stack track (excerpt below) https://gist.github.com/feinbergscott/224c6294eba0634b0db6

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
    at java.security.AccessController.checkPermission(AccessController.java:559)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:431)
    at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1529)
    at java.lang.ClassLoader$1.run(ClassLoader.java:503)
    at java.lang.ClassLoader$1.run(ClassLoader.java:501)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:501)
    at jnr.posix.POSIXFactory.getJavaPOSIX(POSIXFactory.java:91)
    at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:57)
    at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:33)
    at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:29)
    at jnr.posix.LazyPOSIX.stat(LazyPOSIX.java:267)
    at org.jruby.RubyFileTest.directory_p(RubyFileTest.java:106)
1

There are 1 answers

0
kares On

very likely a JRuby regression - maybe try JRuby 1.6.8 how it does ... if it works (or even if not) you should report that latest JNR's JavaPOSIX forces the loading of a class from the package sun.misc which than breaks under a restricted environment such as Google's AppEngine

https://github.com/jnr/jnr-posix/blob/master/src/main/java/jnr/posix/JavaPOSIX.java#L212