首页 > 解决方案 > Geoserver 和 Openlayers - 在 WFS-T 中显示详细的消息错误

问题描述

我已按照此示例使用 geoserver 在 openlayers 地图中保存/编辑元素

地理服务器层通过 postgis 连接到 postgres 数据库;在 postgis 中,我添加了有关插入新记录的某些约束,即两个多边形不能相互接触/不能包含另一个多边形

如何使用 openlayers 显示这些约束错误?使用 WFS-T 插入请求,我只收到以下消息:

<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://myserver:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
    <ows:Exception exceptionCode="InvalidParameterValue">
        <ows:ExceptionText>Update error: Error occured updating features</ows:ExceptionText>
    </ows:Exception>
</ows:ExceptionReport>

我可以在 geoserver 中获取整个堆栈跟踪并确保触发了什么约束,有没有办法通过 openlayers 获得更多细节?

标签: javascriptopenlayersgeoserver

解决方案


全局设置页面中,您可以选中表示include stack trace in service exception在返回给 OpenLayers 的 XML 中提供堆栈跟踪的框。

在此处输入图像描述


推荐阅读