Skip to content

Loading of reference document for annotations fails in Spring Boot #156

@Boltzmann

Description

@Boltzmann

To get a description of Entities or Properties in the form of (xml)
<Annotation Term="Core.Description" String="Description Test"/>
we use the solution of the second step posted in #37 (comment), by creating an extension of JPAEdmMetadataPostProcessor overriding method provideReferences:

String uri = "http://docs.oasisopen.org/odata/odata/v4.0/os/vocabularies/Org.OData.Core.V1.xml";
IntermediateReferenceAccess reference = references.addReference(uri, "annotations/Org.OData.Core.V1.xml");
reference.addInclude("Org.OData.Core.V1", "Core");

However, in Spring Boot this fails with the error

nested exception is com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException: Parsing of 'annotations/Org.OData.Core.V1.xml' failed with message 'file:/app.jar!/BOOT-INF/classes!/annotations/Org.OData.Core.V1.xml (No such file or directory)'.

Reason for this is that the method loadXML in class CsdlDocumentReader uses this.getClass().getClassLoader().getResource(path) instead of this.getClass().getClassLoader().getResourceAsStream(path).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions