question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$metadata not working with native test models

See original GitHub issue

Tried to test Person entity taken from olingo-jpa-processor-v4/jpa/odata-jpa-test/src/main/java/com/sap/olingo/jpa/processor/core/testmodel/Person.java

root URL it works perfectly

image

Collection is also works perfect

image

But $metadata not

image

Getting error OData Library: An exception without message text was thrown.

Onse deleting Persons entity and related classes, $metadata works again

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wog48commented, Mar 21, 2018

It seems that an attribute of either Person.class or BusinessPartner.class has an annotation EdmAnnotation, which can be used to generate simple OData annotation, but corresponding definition of the OData annotations is missing. This is a bug, as you do not get a meaningful error message.

To solve the issue you have two options:

  1. You do not need the OData annotation and remove EdmAnnotation
  2. You want to keep the annotation and perform the following steps:
    • You download Org.OData.Core.V1.xml, store it e.g. under /src/main/resources/annotations
    • You create an extension of JPAEdmMetadataPostProcessor and override method provideReferences using the following code:
    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");
0reactions
wog48commented, Apr 1, 2018

I have enhanced the error processing with version 0.2.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

plugin-under-test-metadata.properties not created by Gradle ...
The first task -- pluginUnderTestMetadata -- makes sure to create the properties file, and is executed by native Gradle as well. The second...
Read more >
Fixing metadata with component metadata rules
If a module was published with Gradle Module Metadata, the metadata is likely complete although there can still be cases where something is...
Read more >
Use Shared Reachability Metadata with Native Image Gradle ...
The GraalVM Reachability Metadata Repository enables Native Image users to share and reuse metadata for libraries and frameworks in the Java ecosystem, and, ......
Read more >
Use file metadata with Cloud Storage on Web - Firebase
There are a number of reasons why errors may occur on getting or updating metadata, including the file not existing, or the user...
Read more >
JUnit 5 User Guide
Writing Tests in JUnit Jupiter. Migrating from JUnit 4 to JUnit Jupiter. Running Tests. Extension Model for JUnit Jupiter. Advanced Topics.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found