DocumentService.load() throws exception

The now deprecated DocumentService.load() method consistently throws an exception in our application:

The validation of document of DM failed. For the entity instance ‘/documentModelId[1]’, the corresponding entity was not found in the corresponding document model. [ERROR,L0,s0,e0],
For the entity instance ‘/empty[1]’, the corresponding entity was not found in the corresponding document model. [ERROR,L0,s0,e0],
For the entity instance ‘/present[1]’, the corresponding entity was not found in the corresponding document model. [ERROR,L0,s0,e0],
For the entity instance ‘/empty[2]’, the corresponding entity was not found in the corresponding document model. [ERROR,L0,s0,e0],

We use DocumentRepository.load() instead, but DocumentService.load() is used internally in com.mgmtp.a12.dataservices.document.operation.internal.GetDocumentOperation.

Is something wrong with our Model / Setup?

After further investigation: This also happens in the GET_DOCUMENT RPC, so curently the application is not working. The DocumentService#load() method uses the QueryService internally to retrieve the document. I can see via debugging that the documment is fetched from the database and deserialized correctly into a JsonNode but the document property of the result seems to contain an Optional that is not unwrapped (?)

DocumentTreeResult(docRef=Steuerfall/e2a1ac7c-5001-4131-88f8-d4dda874b18d, relationshipModel=, sourceRole=, sourceDocRef=null, targetRole=, targetDocRef=null, document={“documentModelId”:“Steuerfall”,“id”:{“empty”:true,“present”:false},“empty”:false}, type=ROOT, backReference=, internalId=70f11edb-b2ea-465c-aa3f-761c8f2b5c86, linkId=null, depth=0, fieldsProjection=false)

At the moment it looks like a bug in A12

Hello @tobias-gentle-alder , thanks for your post within A12 discourse! We’ve forwarded your request to our Data Services team. As they are currently very busy, there may be delays in processing. We apologize for this and hope to be able to provide an answer in a timely manner.

Your discourse team

Hi @tobias-gentle-alder ,

please create an A12 bug ticket and include a document and a model for which load the call throws an exception. We have not observed this problem in our tests and we are very curious to see what is happening there.

Hi @tomas-thin-gale we have solved the issue. Or, it actually is a chain of issues: Our application needs it’s own qualified ObjectMapper beans, which was not a problem in older A12 versions, but now the Spring context initialization complained, that there are multiple ObjectMapper beans, so I had to provide another one with @Primary. This one was of course pristine and did not have all required modules installed (in this case it missed java8module for Optionals). It caused more troubles in other places…