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 at the same package but having different classes in them - result of a split up/refactor that ended up reusing the same package for different classes.
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:
- One for when discriminator column is really not configured in the metadata
- When discriminator column is configured in the metadata but the specific discriminator value could not be mapped to a known PC