使用Google App Engine开发服务器运行新的Rails应用程序时出现java.security.AccessControlException

时间:2013-12-15 12:57:35

标签: java ruby-on-rails jruby jrubyonrails

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.

本地设置:Mac OSX Mavericks,Java 7,JRuby 1.7.6在2.0.0兼容模式下运行。

这是完整的堆栈轨道(摘录如下)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 个答案:

答案 0 :(得分:0)

非常可能是JRuby回归 - 也许尝试JRuby 1.6.8 它是怎么做的...如果它有效(或者即使没有)你应该报告最新的JNR的JavaPOSIX强制加载一个类从包sun.misc开始,而不是在Google的AppEngine等受限制的环境下破解

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