我正在尝试将 Freemarker 2.3 与 GAE 1.7.1 一起使用(我还使用 1.8.1.1 进行了一些测试),但是在 Freemarker 初始化时出现了一个非常奇怪的错误:
java.lang.IllegalAccessError: Class
com.google.appengine.tools.development.agent.runtime.Runtime can not access
a member of class freemarker.log.Log4JLoggerFactory with modifiers ""
at freemarker.log.Logger.createFactory(Logger.java:335)
at freemarker.log.Logger.createFactory(Logger.java:304)
at freemarker.log.Logger.selectLoggerLibrary(Logger.java:163)
at freemarker.log.Logger.getLogger(Logger.java:266)
at freemarker.template.utility.SecurityUtilities.<clinit>(SecurityUtilities.java:67)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:69)
at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
at freemarker.ext.beans.BeansWrapper.<clinit>(BeansWrapper.java:147)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:69)
at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
at freemarker.template.ObjectWrapper.<clinit>(ObjectWrapper.java:69)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:69)
at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
at freemarker.core.Configurable.<init>(Configurable.java:139)
at freemarker.template.Configuration.<init>(Configuration.java:142)
at freemarker.template.Configuration.<clinit>(Configuration.java:127)
它在实例化配置对象时发生:
Configuration configuration = new Configuration();
我尝试使用 Logger.selectLoggerLibrary 调用更改底层记录器,但我有类似的东西......
非常感谢您的帮助。