[Geoserver-devel] [JIRA] (GEOS-10593) Creating SQL View via REST API is not possible

Matthias Heuser created an issue

GeoServer / BugGEOS-10593

Creating SQL View via REST API is not possible

Issue Type:

BugBug

Affects Versions:

2.21.0

Assignee:

Unassigned

Components:

REST

Created:

21/Jul/22 2:31 PM

Priority:

MediumMedium

Reporter:

Matthias Heuser

I am trying to create a layer by adding a feature type via the REST API that is using a virtual table (SQL View).
In the past (version 2.20.x) this worked without issue, but after the upgrade to 2.21.0 the creation fails with the following error:

Failed to access data source to check attribute customization

I then tried to add the layer manually to see if this still works and I was able to add this layer.

Further investigation of the changes between saving via the web application and saving via REST showed the following:

  • saving via web creates a virtual table entry in the JDBCDataSource
  • saving via REST does not create this virtual table entry in the data source
  • a new validation for FeatureTypeInfo (the FeatureTypeValidator) was introduced in 2.21.x
  • this validation fails because the virtual table entry is missing in the data source and there is no database table matching the native name of feature type I am trying to create.

When I added the virtual table entry (using a debugger) in the data source before the validation happens, the saving of the feature type was able to continue successfully.

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#100202-sha1:c075b5d)

Atlassian logo