Postgres 9.5 ERROR: Invalid endian flag value encountered

Description

We are defining below spatial column with PostGIS in Postgres 9.5.
@NotNull
@Column(name = "location", nullable = false, updatable = false, columnDefinition = "Geometry(Point,4326)")
public Point location;

Each time we get an error:
SQL Error: 0, SQLState: XX000
ERROR: Invalid endian flag value encountered
HHH000010: On release of batch it still contained JDBC statements

Activity

Show:

Andrew Slater February 6, 2017 at 4:09 AM

I discovered my issue was that I was not properly setting the property for the postgis dialect (spring.jpa.properties.hibernate.dialect)

Andrew Slater February 6, 2017 at 1:34 AM

I've also been encountering this issue. My configuration is:
Platform: OSX
Postgres 9.6.1
PostGIS: 2.3

Relevant dependencies:
hibernate-core/entity-manager/spatial: 5.2.7.Final
postgres (org.postgresql): 9.4.1212.jre7

Using com.vividsolutions.jts.geom.Point with an @Column annotation. The database column is of type geometry(Point,4326)

{{org.postgresql.util.PSQLException: ERROR: Invalid endian flag value encountered.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)...}}

I poked around a bit and expected that JTSGeometryJavaTypeDescriptor would be used to wrap/unwrap the values but it is not being invoked. I understand a proper test case is probably required to solve this and I will try to put one together. I wanted to at least document what I've found so far.

Incomplete

Details

Assignee

Reporter

Components

Affects versions

Priority

Created September 5, 2016 at 3:12 PM
Updated January 24, 2025 at 2:06 PM
Resolved January 24, 2025 at 2:06 PM

Flag notifications