You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Brian K <ha...@gmail.com> on 2018/08/06 18:43:00 UTC

Application Identity displayed as a list from Wicket Viewer

I have an application identity for my domain object class.  When I load an
individual object from a query that finds exactly one object, this works
fine.

However, when I load a list of these objects, to goes through a part of the
code that encounters this in
org.datanucleus.store.AbstractStoreManager#manageClassForIdentity():

        String className = null;
        if (IdentityUtils.isDatastoreIdentity(id))
        {
            // Check that the implied class is managed
            className =
IdentityUtils.getTargetClassNameForIdentitySimple(id);
            AbstractClassMetaData cmd =
getMetaDataManager().getMetaDataForClass(className, clr);
            if (cmd.getIdentityType() != IdentityType.DATASTORE)
            {
                throw new NucleusUserException(Localiser.msg("038001", id,
cmd.getFullClassName()));
            }
        }
        else if (IdentityUtils.isSingleFieldIdentity(id))
        {
 ....

The id is of type org.datanucleus.identity.DatastoreIdImpl, even though it
is of the identity type APPLICATION.  I am using a single field application
identity because it is part of a composite identity for another class.  I
followed instructions at
http://www.datanucleus.org/products/accessplatform_4_0/jdo/orm/compound_identity.html#a1_N_coll_bi
.  (I used a standard class for PK instead of a static inner class because
the inner class didn't seem to gel with the Isis project, but that's
another story).  This error only happens when I run from the wicket
viewer.  The Wrapper viewer runs the listAll method without any problems.
The Swagger REST viewer displays the list without a problem on the same
server.

The error message reported on the console comes out as:
Caused by: org.datanucleus.exceptions.NucleusUserException: Identity
"1AG-P[OID]domainapp.modules.simple.dom.impl.Court" is assigned to class
"domainapp.modules.simple.dom.impl.Court", but its not the correct
object-id type for this class.
    at
org.datanucleus.store.AbstractStoreManager.manageClassForIdentity(AbstractStoreManager.java:937)
    at
org.datanucleus.ExecutionContextImpl.getClassDetailsForId(ExecutionContextImpl.java:3385)
    at
org.datanucleus.ExecutionContextImpl.findObjects(ExecutionContextImpl.java:3251)
    at
org.datanucleus.api.jdo.JDOPersistenceManager.getObjectsById(JDOPersistenceManager.java:1850)
    at
org.apache.isis.core.runtime.system.persistence.PersistenceSession.loadPersistentPojos(PersistenceSession.java:1010)
    at
org.apache.isis.core.runtime.system.persistence.PersistenceSession.adaptersFor(PersistenceSession.java:1603)
    at
org.apache.isis.core.runtime.system.persistence.PersistenceSession.adaptersFor(PersistenceSession.java:1573)
    at
org.apache.isis.viewer.wicket.model.models.EntityCollectionModel$Type$1.loadInBulk(EntityCollectionModel.java:107)
    at
org.apache.isis.viewer.wicket.model.models.EntityCollectionModel$Type$1.load(EntityCollectionModel.java:93)
    at
org.apache.isis.viewer.wicket.model.models.EntityCollectionModel.load(EntityCollectionModel.java:454)
    at
org.apache.isis.viewer.wicket.model.models.EntityCollectionModel.load(EntityCollectionModel.java:70)
    at
org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:135)
    at
org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.CollectionContentsSortableDataProvider.size(CollectionContentsSortableDataProvider.java:68)
    at
org.apache.wicket.markup.repeater.data.DataViewBase.internalGetItemCount(DataViewBase.java:142)
    at
org.apache.wicket.markup.repeater.AbstractPageableView.getItemCount(AbstractPageableView.java:235)
    at
org.apache.wicket.markup.repeater.AbstractPageableView.getRowCount(AbstractPageableView.java:216)
    at
org.apache.wicket.markup.repeater.AbstractPageableView.getViewSize(AbstractPageableView.java:314)
    at
org.apache.wicket.markup.repeater.AbstractPageableView.getItemModels(AbstractPageableView.java:99)
    at
org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:93)
    at
org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)
    at
org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:115)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:950)
    at org.apache.wicket.Component.beforeRender(Component.java:1018)
    at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1825)
    ... 81 more


Can provide any help on this or reproduce this error?

Thank you!
Brian