Re: PersistentClassROF#getObject method performs a shallow search so not finding all subclasses


Page bloom
 
Edited

I found the cause eventually!

This part of the error is possibly misleading:

Really you need a discriminator to help identifying the type
It seems to suggest that you need to use a discriminator (which we already are) so that could lead the developer to check their metadata etc.,

The real problem was that metadata was missing due to two package.jdo files being provided for the same package but having different classes in them - result of a split up/refactor that ended up reusing the same package name for different classes - some in the main app and some that were migrated to a shared library, hence at runtime two package.jdo files were present "in" the same package (same logical package but two separate package.jdo files).

The root cause was that the lookup of the class name using the discriminator value failed - because the metadata was not present.

Perhaps I can look at making the error a more accurate description of the cause - or maybe it needs two separate error messages:
  1. One for when discriminator column is really not configured in the metadata
  2. When discriminator column is configured in the metadata but the specific discriminator value could not be mapped to a known PC

Join main@datanucleus.groups.io to automatically receive all group messages.