dbeaver/dbeaver · error · DBCException

Unsupported geometry value: {}

Error message

Unsupported geometry value: {}

What it means

Thrown by GISGeometryValueHandler.getValueFromObject() when the supplied object is none of the supported types: null, DBGeometry, org.locationtech.jts.geom.Geometry, byte[], JDBCContentBytes, or String. Any other Java type reaching this handler is rejected as unsupported.

Source

Thrown at plugins/org.jkiss.dbeaver.data.gis/src/org/jkiss/dbeaver/data/gis/handlers/GISGeometryValueHandler.java:155

                bytes = (byte[]) object;
            }
            if (bytes == null || bytes.length == 0) {
                return new DBGeometry();
            }
            try {
                geometry = new DBGeometry(convertGeometryFromBinaryFormat(session, bytes));
            } catch (DBCException e) {
                try {
                    // Might be a WKT
                    geometry = new DBGeometry(new WKTReader().read(new String(bytes)));
                } catch (Exception ignored) {
                    throw new DBCException("Error parsing geometry value from binary", e);
                }
            }
        } else if (object instanceof String) {
            return WKGUtils.parseWKT((String) object);
        } else {
            throw new DBCException("Unsupported geometry value: " + object);
        }
        if (geometry.getSRID() == 0) {
            geometry.setSRID(defaultSRID);
        }
        return geometry;
    }

    @NotNull
    protected Geometry convertGeometryFromBinaryFormat(@Nullable DBCSession session, @NotNull byte[] object) throws DBCException {
        try (ByteArrayInputStream is = new ByteArrayInputStream(object)) {
            int srid = 0;

            if (leadingSRID) {
                // Read SRID with little endian order (the least significant bytes come first)
                srid |= is.read();
                srid |= is.read() << 8;
                srid |= is.read() << 16;
                srid |= is.read() << 24;

View on GitHub (pinned to 1e5ee1042b)

Solutions

  1. Confirm the column type actually delivers byte[], String, Geometry, or JDBCContentBytes; if it returns another type, register a different value handler.
  2. Convert/pre-process the value into a supported type (bytes or WKT string) before passing it to getValueFromObject.
  3. Review the dataTypeProvider / value handler registration in plugin.xml to ensure GISGeometryValueHandler is bound only to genuine geometry column types.
  4. Inspect object.getClass() at the call site to identify the unexpected type and adjust the binding.

Example fix

// before: an unhandled type reaches the geometry handler and throws
Object v = resultSet.getObject(index);   // e.g. returns a SQLXML
geometry = handler.getValueFromObject(session, type, v, false, true);

// after: coerce to a supported representation before parsing
Object v = resultSet.getObject(index);
if (v instanceof SQLXML xml) v = xml.getString();   // now a WKT/WKB string
geometry = handler.getValueFromObject(session, type, v, false, true);
Defensive patterns

Strategy: type-guard

Type guard

// Only route supported types into the geometry handler
static boolean isSupportedGeometryValue(Object o) {
    return o == null
        || o instanceof DBGeometry
        || o instanceof org.locationtech.jts.geom.Geometry
        || o instanceof byte[]
        || o instanceof JDBCContentBytes
        || o instanceof String;
}

Prevention

When it happens

Trigger: getValueFromObject(session, type, object, ...) is called with an object of an unrecognized class — e.g. an Integer, Long, java.sql.SQLXML, a structured object, or a driver-specific custom type that the value handler was incorrectly registered to handle.

Common situations: A dataTypeProvider/valueHandler extension was registered for a column type that delivers a non-binary/non-string Java object; a driver returns an unexpected type for a column mapped to GISGeometryValueHandler; a misconfigured type binding routes the wrong column type to this handler.

Related errors


AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13). Data as JSON: /api/errors/ee7dd5b0f7ae31d8. Report an issue: GitHub.