由于HashMap $ Entry ClassNotFound错误,Grails应用程序无法在GoogleAppEngine中运行

时间:2012-03-08 21:18:42

标签: google-app-engine grails groovy

我正在尝试将我的Grails项目移植到GAE,现在它已经支持Cloud SQL了。我没有使用Grails App Engine插件,因为它似乎不支持Cloud SQL(毕竟它是相当新的)。我能够设法让我的Grails项目在Google Java Development Server下的localhost上运行,一切正常。但是在我将应用程序上传到Google Appspot之后,该应用程序无法初始化引用java.util.HashMap $ Entry的ClassNotFound。我的直觉是,常规增强型Hashmap类使用了App Engine不允许的一些功能,从而阻止了它的加载。但我是一个时髦的新手,所以不知道从哪里开始挖掘Groovy。

堆栈跟踪:

Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@92af24{/,/base/data/home/apps/fluentifyme/1.357352126538464031}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.SecurityException: Unable to get members for class groovy.util.ConfigObject
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:202)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:171)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:422)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.SecurityException: Unable to get members for class groovy.util.ConfigObject
    at java.security.AccessController.doPrivileged(AccessController.java:34)
    at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
    at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
    ... 1 more
Caused by: java.lang.reflect.InvocationTargetException
    ... 10 more
Caused by: java.lang.NoClassDefFoundError: [Ljava/util/HashMap$Entry;
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2444)
    at java.lang.Class.getDeclaredMethods(Class.java:1808)
    ... 10 more
Caused by: java.lang.ClassNotFoundException: java.util.HashMap$Entry
    ... 10 more

1 个答案:

答案 0 :(得分:0)

您似乎遇到了与ConfigSlurper相关的this reported bug以及GAE的安全限制。正如错误所示,您可能可以切换到使用JsonSlurper来解决此问题。