Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
(Java) V4 4.9.0
-
None
-
Patch, Important
Description
I implemented Odata4 JPA implementation using Apache Olingo 4.9.0. JPA library used for this implementation is: SAP Olingo JPA processor - https://github.com/SAP/olingo-jpa-processor-v4/tree/main ,I use EclipseLink for persistence API access.
When I use one of the Apache Olingo 4 Spatial data types (org.apache.olingo.commons.api.edm.geo) in my @Entity java classes then Spring Boot program fails to start with error:
Caused by: org.eclipse.persistence.exceptions.EntityManagerSetupException:
Exception Description: Predeployment of PersistenceUnit [default] failed.
Internal Exception: Exception [EclipseLink-7155] (Eclipse Persistence Services - 2.7.13.v20230724-7ffb888abf): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class org.apache.olingo.commons.api.edm.geo.GeospatialCollection] for the attribute [geography] on the entity class [class com.cgi.inm.odata4.model.Switch] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:233) ~[eclipselink-2.7.13.jar:2.7.13.v20230724-7ffb888abf]
The tech stack for this program is:
- Spring Boot 2.7.14
- Java 8
- Apache Olingo 4.9.0
- SAP JPA Processor 1.0.9
- Eclipselink 2.7.13
After implementing Serializable interface at org.apache.olingo.commons.api.edm.geo.Geospatial.java the error has gone and I am able to read and write geospatial data type