Patrick Aboagye
Patrick Aboagye

Reputation: 41

Cannot save to geometry field from app deployed in Glassfish to Postgres13 with Postgis3.1.7

I have this weird issue where I cannot read or write to geometry fields in my Database. INSERT INTO digital_addresses(gps_coordinates, digital_address) VALUES (ST_SetSRID(ST_MakePoint(?, ?), 4326), ?) fails with the error:

exception in get getOrSaveDigitalAddress. Reason: ERROR: function st_makepoint(real, real) does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
  Position: 233

I know postgis is installed correctly because I am able to execute same query from pgAdmin.

I have tried putting postgis-geometry-2.5.1.jar, postgis-jdbc-2.5.0.jar and postgresql-42.2.25.jar in different permutations and different versions into {domain_dir}/domain1/lib/ext still the issue persists.

select select postgis_full_version():

POSTGIS="3.1.7 aafe1ff" [EXTENSION] PGSQL="130" GEOS="3.9.2-CAPI-1.14.3" PROJ="8.2.1" LIBXML="2.9.7" LIBJSON="0.13.1" LIBPROTOBUF="1.3.0" WAGYU="0.5.0 (Internal)"

Does anyone know what might be wrong or what versions of postgressql and postgis should work for my setup.

Thanks!

Upvotes: 0

Views: 52

Answers (1)

Pauel
Pauel

Reputation: 13

If gps_coordinates field type is GEOMETRY try this one: INSERT INTO digital_addresses (gps_coordinates, digital_address) VALUES (ST_GeomFromText('POINT(-70.064544 40.28787)',4326)), ?)

Upvotes: 0

Related Questions