読者です 読者をやめる 読者になる 読者になる

GAE/JのJDOではまり中

なんだか親子関係のEntityに対して登録はできるが取得はできなくなってしまった。いつからだ??
今日はもう時間切れ。
slim3を使っていますが、下記のようなコードでも同様のエラーが出たのでslim3は直接関係ないかも?

QueryResult s = (QueryResult)pm.newQuery(Oya.class).execute();
Oya oya = (Oya)s.toArray()[0];
System.out.println(oya.getKodomo().size()); // 1
oya.getKodomo().get(0); // ExceptionInInitializerError

エラーの内容は下記

java.lang.ExceptionInInitializerError
	at org.datanucleus.store.appengine.DatastoreAdapter.newQueryStatement(DatastoreAdapter.java:172)
	at org.datanucleus.store.mapped.query.UnionIteratorStatement.getQueryForElement(UnionIteratorStatement.java:406)
	at org.datanucleus.store.mapped.query.UnionIteratorStatement.getQueryStatement(UnionIteratorStatement.java:271)
	at org.datanucleus.store.mapped.scostore.FKListStore.getIteratorStatement(FKListStore.java:355)
	at org.datanucleus.store.mapped.scostore.AbstractListStore.listIterator(AbstractListStore.java:98)
	at org.datanucleus.store.mapped.scostore.AbstractListStore.listIterator(AbstractListStore.java:83)
	at org.datanucleus.store.mapped.scostore.AbstractListStore.iterator(AbstractListStore.java:73)
	at org.datanucleus.sco.backed.List.loadFromStore(List.java:274)
	at org.datanucleus.sco.backed.List.get(List.java:531)
	at study.OyaController.doTestRun(Oya.java:28)
	at org.slim3.controller.Controller.runBare(Controller.java:70)
	at org.slim3.controller.FrontController.processController(FrontController.java:465)
	at org.slim3.controller.FrontController.doFilterInternal(FrontController.java:291)
	at org.slim3.controller.FrontController.doFilter(FrontController.java:252)
	at org.slim3.controller.FrontController.doFilter(FrontController.java:210)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:306)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:313)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
	at java.security.AccessController.checkPermission(AccessController.java:546)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:122)
	at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:107)
	at org.datanucleus.store.appengine.DatastoreQueryExpression.getDeclaredFieldQuietly(DatastoreQueryExpression.java:109)
	at org.datanucleus.store.appengine.DatastoreQueryExpression.<clinit>(DatastoreQueryExpression.java:95)
	... 36 more

jdo.config

<?xml version="1.0" encoding="utf-8"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">

   <persistence-manager-factory>
       <property name="javax.jdo.PersistenceManagerFactoryClass"
           value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
       <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
       <property name="javax.jdo.option.NontransactionalRead" value="true"/>
       <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
       <property name="javax.jdo.option.Optimistic" value="false"/>
       <property name="javax.jdo.option.RetainValues" value="true"/>
       <property name="datanucleus.DetachOnClose" value="true"/>
       <property name="datanucleus.CopyOnAttach" value="false"/>
       <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
   </persistence-manager-factory>


</jdoconfig>