1 Reply Latest reply on Sep 2, 2003 8:00 AM by jjarkko

    Could not create an instance of PersistenceCapable: java.uti

      I've the following POJO defined:
      public class User {
      ...
      private Collection roles;
      }

      with the following JDO-metadata:
      <field name="roles" embedded="false" default-fetch-group="false">
      <collection element-type="Role"/>
      <extension vendor-name="jboss" key="target-foreign-key-column" value="PARENT_FK"/>


      When trying to instantiate the User- jboss throws an JDOFatalInternalException.
      javax.jdo.JDOFatalInternalException: Could not create an instance of PersistenceCapable: java.util.Collection

      Any idea what might be wrong? I'm running DR3 (from the cvs)

      ps. The spell checker on the forum doesn't work..


        • 1. Re: Could not create an instance of PersistenceCapable: java

          Ah, managed to solve the previous one. Had to give a real key name for "target-foreign-key-column". But i'm now facing a next problem;
          6:39:52,399 DEBUG [StoreManagerImpl] load command: SELECT user_jdoField_User_roles.JOID FROM user user LEFT JOIN roles user_jdoField_User_roles ON (user.OID = user_jdoField_User_roles.USER_UID) WHERE user.OID = '1'
          16:43:59,294 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
          java.lang.NullPointerException
          at javax.jdo.spi.JDOImplHelper.newObjectIdInstance(JDOImplHelper.java:112)
          at org.jboss.persistence.jbossdo.schema.JDOIdentity.postLoadList(JDOIdentity.java:143)
          at org.jboss.persistence.jbossdo.schema.JDO1ToXAssociation.postLoad(JDO1ToXAssociation.java:95)
          at org.jboss.persistence.jbossdo.schema.JDOAssociationEndField.postLoad(JDOAssociationEndField.java:311)
          at org.jboss.persistence.jbossdo.schema.JDOClass.postLoad(JDOClass.java:113)
          at org.jboss.persistence.jbossdo.store.StoreManagerImpl.load(StoreManagerImpl.java:137)
          at org.jboss.persistence.jbossdo.JBossPersistenceManagerInternal.load(JBossPersistenceManagerInternal.java:193)
          at org.jboss.persistence.jbossdo.JBossStateManagerImpl.load(JBossStateManagerImpl.java:271)
          at org.jboss.persistence.jbossdo.JBossStateManagerImpl.getObjectField(JBossStateManagerImpl.java:363)
          at fi.jab.poc.User.getRoles(User.java:97)


          From what i can see is that in javax.jdo.spi.JDOImplHelper.newObjectIdInstance() getMetaByClass(...) the metaByClass-map doesn't have a value for the Role-class, there's only one class in the map, the User Class. I tried to follow the example in the JBossJDO-project example page but somehow the thing doesn't seem to work..