HTTP 500 response on REST DELETE workspace with JDBC Config enabled

Description

Deleting a single workspace either through the UI or REST in both GeoServer 2.10 and 2.11 when JDBC Configuration is enabled will return an error response even though the workspace is successfully deleted. If multiple workspaces are deleted at the same time through the UI, then the first workspace will be successfully deleted but it will throw an error that prevents the rest of the workspaces from being deleted.

In both the UI and REST, the namespace will be removed before removing the workspace.
org.geoserver.catalog.NamespaceWorkspaceConsistencyListener also deletes the workspace when a namespace is deleted so I think that GeoServer actually tries to delete the workspace twice and the second delete causes the error.
org.geoserver.jdbcconfig.internal.ConfigDatabase.remove(Info) calls findObjectId(info) and tries to check for a null id but findObjectId throws an exception instead of returning null.

Environment

None

Status

Assignee

Unassigned

Reporter

Steve Ikeoka

Triage

None

Fix versions

Affects versions

2.10.1
2.11.1

Components

Priority

Medium
Configure