Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export GeoPackge fails due to mis-matched end-tags in XML #166

Open
emxsys opened this issue Jun 25, 2018 · 2 comments
Open

Export GeoPackge fails due to mis-matched end-tags in XML #166

emxsys opened this issue Jun 25, 2018 · 2 comments
Labels

Comments

@emxsys
Copy link
Contributor

emxsys commented Jun 25, 2018

After the upgrade to GeoServer 2.13, the export GeoPackage process generates a valid XML, but somewhere in the process, the XML end-tags end up with ":" chars injected into the end-tags.
For example: <layers>...</:layers>

Error text:

<wps:ExecuteResponse xml:lang="en" service="WPS" serviceInstance="http://cobra:8080/geoserver/ows?" version="1.0.0">
  <wps:Process wps:processVersion="1.0.0">
    <ows:Identifier>gs:GeoPackage</ows:Identifier><ows:Title>GeoPackage</ows:Title>
    <ows:Abstract>Geopackage Process</ows:Abstract>
  </wps:Process>
  <wps:Status creationTime="2018-06-26T23:07:14.003Z">
    <wps:ProcessFailed>
      <ows:ExceptionReport version="1.1.0">
        <ows:Exception exceptionCode="NoApplicableCode">
          <ows:ExceptionText>Failed to retrieve value for input contents
The element type &quot;layers&quot; must be terminated by the matching end-tag &quot;&lt;/layers&gt;&quot;.
          </ows:ExceptionText>
        </ows:Exception>
      </ows:ExceptionReport>
    </wps:ProcessFailed>
  </wps:Status>
</wps:ExecuteResponse>
@emxsys emxsys added the bug label Jun 25, 2018
@emxsys
Copy link
Contributor Author

emxsys commented Jun 25, 2018

Example

Here is the XML for exporting a GeoPackage. Note the embedded colon chars in the layers and srs tags.

<?xml version="1.0" encoding="UTF-8"?><wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
  <ows:Identifier>gs:GeoPackage</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>contents</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="text/xml; subtype=geoserver/geopackage">
          <geopackage xmlns="http://www.opengis.net/gpkg" name="world">
            <tiles name="world">
              <layers>test:world</layers>
              <styles>raster</styles>
              <transparent>false</transparent>
              <bbox>
                <minx>-180.0</minx>
                <miny>-90.0</miny>
                <maxx>180.0</maxx>
                <maxy>90.0</maxy>
              </bbox>
              <srs>EPSG:4326</srs>
              <coverage>
                <minZoom>0</minZoom>
                <maxZoom>8</maxZoom>
              </coverage>
            </tiles>
          </geopackage>
        </wps:ComplexData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput>
      <ows:Identifier>geopackage</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm>
</wps:Execute>

Problem

GeoPackageProcessRequestPPIO.decode receives the following input (note the ":" in the end-tags after the layers tag.

input = (java.lang.String) "<geopackage name="world" xmlns:wfs='http://www.opengis.net/wfs' xmlns:xml='http://www.w3.org/XML/1998/namespace' xmlns:wcs='http://www.opengis.net/wcs/1.1.1' xmlns:gml='http://www.opengis.net/gml' xmlns:ows='http://www.opengis.net/ows/1.1' xmlns:ogc='http://www.opengis.net/ogc' xmlns:wps='http://www.opengis.net/wps/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xlink='http://www.w3.org/1999/xlink'>
            <tiles name="world">
              <layers>test:world</:layers>
              <styles>raster</:styles>
              <transparent>false</:transparent>
              <bbox>
                <minx>-180.0</:minx>
                <miny>-90.0</:miny>
                <maxx>180.0</:maxx>
                <maxy>90.0</:maxy>
              </:bbox>
              <srs>EPSG:4326</:srs>
              <coverage>
                <minZoom>0</:minZoom>
                <maxZoom>8</:maxZoom>
              </:coverage>
            </:tile...

@emxsys
Copy link
Contributor Author

emxsys commented Jun 25, 2018

More Info

Upon further review, the it seems all the closing end-tags have an embedded colon. In a debugging hack, i simply replaced the </: string with </ in GeoPackageProcessRequestPPIO.decode and that allows the export process to proceed, only to generate this error:

gs:GeoPackageGeoPackageGeopackage ProcessFailed to retrieve value for input contents 
Errors were encountered while parsing GeoPackage contents: 
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 422; 
cvc-elt.1: Cannot find the declaration of element &apos;geopackage&apos;.]

I would appear the entity resolver registered in applicationContext.xml cannot be found or was not loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant