Skip to Content

Lately I was playing around with HCP and Olingo and wanted to expose a JPA model as OData. I created some data using EJB and then tried to read this data via OData. Accessing the collection gave me a list of created entities, but when I tried to access one using its key, I got only the error message: Requested entity could not be found. Exemple: http://localhost:8080/service.svc/Events(8L)

<error xmlns="">
<message xml:lang="en-US">Requested entity could not be found.</message>

Thing is: the entity was there. I know it (I have DB access), I just could not access it. Turned out that the version of org.eclipse.persistence.jpa I was using does not like when the @ID key is of type long (8L). Using version >= 2.5.2 solved the issue for me. Changing my pom.xml:


Now I can access the entity using the ID as key in the URL.

More information about this can be found on my private blog.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply