Uploaded image for project: 'GeoServer'
  1. GeoServer
  2. GEOS-7524

Adding a readonly rule in GeoFence will provoke a NullPointer exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.3, 2.10.1, 2.11-beta
    • Component/s: GeoFence, WFS
    • Labels:
      None

      Description

      Defining an attribute READONLY rule in GeoFence will provoke a NullPointerException during a WFS transaction request to the layer, regardless if we try to update the READONLY attribute or not.

      Using an external GeoFence instance (version 3.2.0) and a GeoServer instance (master) with the GeoFence community module.

      To reproduce the error using the layer feature:bugsites shipped with GeoServer, define a READONLY attribute rule in GeoFence (see print-screen).

      And try this requests:

      Updating the READONLY attribute

      curl 'http://localhost/geoserver/wfs' -H 'Content-Type: application/xml' --data-binary '<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"><wfs:Update typeName="feature:bugsites" xmlns:feature="http://www.openplans.org/spearfish"><wfs:Property><wfs:Name>str1</wfs:Name><wfs:Value>Beetle site UPDATE</wfs:Value></wfs:Property><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId fid="bugsites.1"/></ogc:Filter></wfs:Update></wfs:Transaction>' --compressed

      Updating another attribute

      curl 'http://localhost/geoserver/wfs' -H 'Content-Type: application/xml' --data-binary '<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"><wfs:Update typeName="feature:bugsites" xmlns:feature="http://www.openplans.org/spearfish"><wfs:Property><wfs:Name>cat</wfs:Name><wfs:Value>10</wfs:Value></wfs:Property><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId fid="bugsites.1"/></ogc:Filter></wfs:Update></wfs:Transaction>' --compressed

      In both cases the response should be:

      <ows:ExceptionReport version="1.0.0" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
          <ows:Exception exceptionCode="NoApplicableCode">
              <ows:ExceptionText>java.lang.NullPointerException</ows:ExceptionText>
          </ows:Exception>
      </ows:ExceptionReport>
      

      Stack-trace attached.

        Attachments

          Activity

            People

            • Assignee:
              nmco Nuno Oliveira
              Reporter:
              nmco Nuno Oliveira
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: