title: App Engine Datanucleus JPA throwing javax.persistence.PersistenceException on Collection properties of Entities
body: <p>The error occurs at runtime after the enhancement has been done successfully. I thought it had got to do with entity relationships but further probe showed that the exception is due to having a collection interface as a property in the entity. List will cause the exception but ArrayList won't. Set will but SortedSet won't. Please help me.</p>
  <pre><code>package model;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import javax.persistence.ElementCollection;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  
  @Entity
  public class Person {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
  
      // @ElementCollection
      private List&lt;String&gt; name = new ArrayList&lt;String&gt;();
      private char gender;
      private int age;
  
      public Long getId() {
          return id;
      }
  
      public List&lt;String&gt; getName() {
          return name;
      }
  
      public char getGender() {
          return gender;
      }
  
      public int getAge() {
          return age;
      }
  
      public void setName(List&lt;String&gt; name) {
          this.name = name;
      }
  
      public void setGender(char gender) {
          this.gender = gender;
      }
  
      public void setAge(int age) {
          this.age = age;
      }
  }
  </code></pre>
  <pre><code>        EntityManagerFactory emf = EMF.get();
          EntityManager em = null;
  
          try {
              em = emf.createEntityManager();
              Query query = em.createQuery(&quot;SELECT p FROM Person p&quot;);
              System.out.println(&quot;Got Here!!!&quot;);
              List&lt;Person&gt; persons = new ArrayList&lt;Person&gt;();
              persons = (List&lt;Person&gt;) query.getResultList();
              
          } finally {
              if (em != null)
                  em.close();
          }
  </code></pre>
  <p>Stack Trace</p>
  <pre><code>[junitlauncher] Running test.web.HomePageTest
       [exec] 2022-05-07 09:41:35.005:WARN:oejs.HttpChannel:qtp1367165453-19: /Got Here!!!
       [exec]
       [exec] javax.persistence.PersistenceException: Class &quot;model.Person&quot; field &quot;model.Person&quot; : declared as a reference type (interface/Object) but no implementation classes of &quot;java.util.List&quot; have been found!
       [exec]     at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:302)    
       [exec]     at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:202)
       [exec]     at controller.MockController.doGet(Unknown Source)
       [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
       [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
       [exec]     at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
       [exec]     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)
       [exec]     at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:148)   
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:46)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:74)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:62)   
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.jetty9.StaticFileFilter.doFilter(StaticFileFilter.java:138)        
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:377)
       [exec]     at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:360)
       [exec]     at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:127)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.DevAppServerRequestLogFilter.doFilter(DevAppServerRequestLogFilter.java:44)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
       [exec]     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:571)
       [exec]     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
       [exec]     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
       [exec]     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
       [exec]     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
       [exec]     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
       [exec]     at com.google.appengine.tools.development.jetty9.DevAppEngineWebAppContext.doScope(DevAppEngineWebAppContext.java:109)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
       [exec]     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
       [exec]     at com.google.appengine.tools.development.jetty9.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:613)
       [exec]     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
       [exec]     at org.eclipse.jetty.server.Server.handle(Server.java:516)
       [exec]     at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
       [exec]     at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
       [exec]     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
       [exec]     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
       [exec]     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
       [exec]     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
       [exec]     at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
       [exec]     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
       [exec]     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
       [exec]     at java.base/java.lang.Thread.run(Thread.java:834)
       [exec] Caused by:
       [exec] org.datanucleus.metadata.InvalidMemberMetaDataException: Class &quot;model.Person&quot; field &quot;model.Person&quot; : declared as a reference type (interface/Object) but no implementation classes of &quot;java.util.List&quot; have been found!
       [exec]     at org.datanucleus.metadata.MetaDataUtils.getImplementationNamesForReferenceField(MetaDataUtils.java:549)    
       [exec]     at org.datanucleus.store.mapped.mapping.ReferenceMapping.createPerImplementationColumnsForReferenceField(ReferenceMapping.java:288)
       [exec]     at org.datanucleus.store.mapped.mapping.ReferenceMapping.prepareDatastoreMapping(ReferenceMapping.java:210)  
       [exec]     at org.datanucleus.store.mapped.mapping.ReferenceMapping.initialize(ReferenceMapping.java:106)
       [exec]     at org.datanucleus.store.mapped.mapping.InterfaceMapping.initialize(InterfaceMapping.java:52)
       [exec]     at org.datanucleus.store.mapped.mapping.MappingFactory.createMapping(MappingFactory.java:97)
       [exec]     at org.datanucleus.store.mapped.mapping.AbstractMappingManager.getMapping(AbstractMappingManager.java:263)   
       [exec]     at com.google.appengine.datanucleus.mapping.DatastoreTable.addFieldMapping(DatastoreTable.java:491)
       [exec]     at com.google.appengine.datanucleus.mapping.DatastoreTable.initializeNonPK(DatastoreTable.java:436)
       [exec]     at com.google.appengine.datanucleus.mapping.DatastoreTable.buildMapping(DatastoreTable.java:374)
       [exec]     at com.google.appengine.datanucleus.DatastoreManager.buildStoreData(DatastoreManager.java:439)
       [exec]     at com.google.appengine.datanucleus.DatastoreManager.newStoreData(DatastoreManager.java:403)
       [exec]     at org.datanucleus.store.AbstractStoreManager.addClasses(AbstractStoreManager.java:1183)
       [exec]     at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:1157)
       [exec]     at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:407)
       [exec]     at com.google.appengine.datanucleus.DatastoreManager.getDatastoreClass(DatastoreManager.java:544)
       [exec]     at com.google.appengine.datanucleus.query.DatastoreQuery.compile(DatastoreQuery.java:234)
       [exec]     at com.google.appengine.datanucleus.query.JPQLQuery.performExecute(JPQLQuery.java:170)
       [exec]     at org.datanucleus.store.query.Query.executeQuery(Query.java:1789)
       [exec]     at org.datanucleus.store.query.Query.executeWithMap(Query.java:1693)
       [exec]     at org.datanucleus.api.jpa.JPAQuery.getResultList(JPAQuery.java:185)
       [exec]     at controller.MockController.doGet(Unknown Source)
       [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
       [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
       [exec]     at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
       [exec]     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)
       [exec]     at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:148)   
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:46)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:74)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:62)   
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.jetty9.StaticFileFilter.doFilter(StaticFileFilter.java:138)        
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:377)
       [exec]     at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:360)
       [exec]     at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:127)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at com.google.appengine.tools.development.DevAppServerRequestLogFilter.doFilter(DevAppServerRequestLogFilter.java:44)
       [exec]     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
       [exec]     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:571)
       [exec]     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
       [exec]     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
       [exec]     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
       [exec]     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
       [exec]     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
       [exec]     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
       [exec]     at com.google.appengine.tools.development.jetty9.DevAppEngineWebAppContext.doScope(DevAppEngineWebAppContext.java:109)
       [exec]     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
       [exec]     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
       [exec]     at com.google.appengine.tools.development.jetty9.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:613)
       [exec]     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
       [exec]     at org.eclipse.jetty.server.Server.handle(Server.java:516)
       [exec]     at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
       [exec]     at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
       [exec]     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
       [exec]     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
       [exec]     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
       [exec]     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
       [exec]     at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
       [exec]     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
       [exec]     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
       [exec]     at java.base/java.lang.Thread.run(Thread.java:834)
  </code></pre>
  <p>Dependencies</p>
  <pre><code>        &lt;!-- https://mvnrepository.com/artifact/com.google.appengine.orm/datanucleus-appengine --&gt;
          &lt;dependency org=&quot;com.google.appengine.orm&quot; name=&quot;datanucleus-appengine&quot; rev=&quot;2.1.2&quot; conf=&quot;compile-&gt;default;runtime-&gt;default&quot; /&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/org.datanucleus/datanucleus-api-jpa --&gt;
          &lt;dependency org=&quot;org.datanucleus&quot; name=&quot;datanucleus-api-jpa&quot; rev=&quot;3.1.3&quot; conf=&quot;compile-&gt;default;runtime-&gt;default&quot; /&gt;
          
          &lt;!-- https://mvnrepository.com/artifact/org.ow2.asm/asm --&gt;
          &lt;dependency org=&quot;org.ow2.asm&quot; name=&quot;asm&quot; rev=&quot;9.2&quot; conf=&quot;compile-&gt;default;runtime-&gt;default&quot; /&gt;
  </code></pre>