[Geoserver-devel] [JIRA] (GEOS-10824) gs-flatgeobuf extension can clash with "directory of shapefiles" datastores

Pierre Mauduit created an issue

GeoServer / BugGEOS-10824

gs-flatgeobuf extension can clash with “directory of shapefiles” datastores

Issue Type:

BugBug

Affects Versions:

2.20.4

Assignee:

Unassigned

Created:

13/Jan/23 2:07 PM

Environment:

Encountered on a geOrchestra geoserver 2.20.4, including gs-flatgeobuf extension, but this may affect more recent versions as well.

  • docker image being used relies on an official jetty docker image
  • linux environment, kernel v4.4.0

Priority:

MediumMedium

Reporter:

Pierre Mauduit

This issue has been reported on the geoserver-devel mailing-list:

https://sourceforge.net/p/geoserver/mailman/geoserver-devel/thread/CAHTJp2Stfaz8b%2BDuafketpYag1K3nTe40Vi7tFKk3ZpQVCrO6g%40mail.gmail.com/#msg37761887

When using a GeoServer along with the gs-flatgeobuf extension, the gt-flatgeobuf comes naturally as a dependency, and this might cause issues with datastores, because GeoServer could select the wrong factory to manage said datastores. From our understanding this following call to getAvailableDataStoreFactories() could be the cause:

https://github.com/geoserver/geoserver/blob/main/src/main/src/main/java/org/vfny/geoserver/util/DataStoreUtils.java#L92

There are no ordering in the collection being returned, and canProcess() methods from both factories will return true with the given params hashmap:

So depending on the order, we can end up with a “directory of shapefiles” datastore which would be handled by a FlatGeobufDatastoreFactory, resulting in every underlying layers fail.

One workaround from our side had been to remove the flatgeobuf extension (incl. the gt-flatgeobuf jar from the webapp’s classpath), as the format was actually not needed/not in use in our environment.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100214-sha1:b03f6a4)

Atlassian logo