我在 Google App Engine 中的 Runnable 对象上创建了一个后台线程,如下所示:
BackendService s = new BackendService();
thread = ThreadManager.createBackgroundThread(s);
thread.start();
但是 - 在初始化时获取 PersistenceManagerFactory ,我这样做是这样的:
private static final PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory("transactional");
我得到一个类加载器异常:
Uncaught exception from servlet
com.google.apphosting.runtime.FatalError: A not-user-defined ClassLoader was set as the thread'scontextClassLoader: sun.misc.Launcher$AppClassLoader@1a8c4e7
at com.google.appengine.runtime.Request.process-f71d5e950ca508ff(Request.java)
at java.security.AccessController.doPrivileged(AccessController.java:34)
我究竟做错了什么?