0

When I try to run a WPS process for clipping a WCS raster data with a GeoJSON data it fails to complete the job. But when I do the same with WKT string as a input it completes successfully.

Failed WPS process with JSON input

<?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>ras:CropCoverage</ows:Identifier> <wps:DataInputs> <wps:Input> <ows:Identifier>coverage</ows:Identifier> <wps:Reference mimeType="image/tiff" xlink:href="http://geoserver/wcs" method="POST"> <wps:Body> <wcs:GetCoverage service="WCS" version="1.1.1"> <ows:Identifier>nu:NE2_50M_SR</ows:Identifier> <wcs:DomainSubset> <ows:BoundingBox crs="http://www.opengis.net/gml/srs/epsg.xml#4326"> <ows:LowerCorner>-180.0 -90.0</ows:LowerCorner> <ows:UpperCorner>180.0 90.0</ows:UpperCorner> </ows:BoundingBox> </wcs:DomainSubset> <wcs:Output format="image/tiff"/> </wcs:GetCoverage> </wps:Body> </wps:Reference> </wps:Input> <wps:Input> <ows:Identifier>cropShape</ows:Identifier> <wps:Data> <wps:ComplexData mimeType="application/json"><![CDATA[ { "type": "Polygon", "coordinates": [ [ [ 74.332365694231868, 20.348533699212016 ], [ 74.005883315616018, 18.018636724544315 ], [ 76.988745047515422, 16.875948399388822 ], [ 74.332365694231868, 20.348533699212016 ] ] ] } ]]> </wps:ComplexData> </wps:Data> </wps:Input> </wps:DataInputs> <wps:ResponseForm> <wps:RawDataOutput mimeType="image/jpeg"> <ows:Identifier>result</ows:Identifier> </wps:RawDataOutput> </wps:ResponseForm> </wps:Execute> 

Geoserver log error message

08 Dec 14:35:12 ERROR [wps.executor] - Process execution failed org.geoserver.wps.WPSException: Failed to retrieve value for input cropShape at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:97) at org.geoserver.wps.executor.LazyInputMap.get(LazyInputMap.java:49) at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:736) at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:616) at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50) at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:224) at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:192) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureHandler.<init>(org.locationtech.jts.geom.GeometryFactory) at org.geotools.geojson.DelegatingHandler.createDelegate(DelegatingHandler.java:125) at org.geotools.geojson.geom.GeometryHandler.primitive(GeometryHandler.java:58) at org.json.simple.parser.JSONParser.parse(JSONParser.java:428) at org.json.simple.parser.JSONParser.parse(JSONParser.java:312) at org.geotools.geojson.GeoJSONUtil.parse(GeoJSONUtil.java:278) at org.geotools.geojson.geom.GeometryJSON.parse(GeometryJSON.java:623) at org.geotools.geojson.geom.GeometryJSON.read(GeometryJSON.java:181) at org.geoserver.wps.ppio.GeoJSONPPIO$Geometries.decode(GeoJSONPPIO.java:104) at org.geoserver.wps.ppio.CDataPPIO.decode(CDataPPIO.java:21) at org.geoserver.wps.executor.SimpleInputProvider.getValueInternal(SimpleInputProvider.java:81) at org.geoserver.wps.executor.AbstractInputProvider.getValue(AbstractInputProvider.java:100) at org.geoserver.wps.executor.ValidatingInputProvider.getValue(ValidatingInputProvider.java:39) at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:89) ... 10 more Caused by: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureHandler.<init>(org.locationtech.jts.geom.GeometryFactory) at java.base/java.lang.Class.getConstructor0(Class.java:3349) at java.base/java.lang.Class.getConstructor(Class.java:2151) at org.geotools.geojson.DelegatingHandler.createDelegate(DelegatingHandler.java:119) ... 22 more 

This issue is not seen in GeoServer 2.18.0 when I tested it. I can see a bug for this in GEOS Jira are there any updates on this?

4
  • please don't use images of text - it is almost impossible to read on a phone or if you are visually impaired. Commented Dec 8, 2022 at 15:42
  • also we need to see the actual error message but I doubt it's the same as the one you are seeing as that isn't a bug Commented Dec 8, 2022 at 15:44
  • The stack trace is not making sense for a 2.22.0, it should go through a completely different path to read GeoJSON geometries. Unless you are mixing a GeoServer 2.22.0 release with a WPS picked from a 2.20.x (or earlier) series? Commented Dec 9, 2022 at 14:57
  • No I haven't made any changes. I tried his with docker image kartoza/geoserver:2.22.0 as well as the latest Geoserver 2.22.0 windows installer with the same version WPS plugin. Can you please test it with the latest version and see if this the same for you? Thanks. @AndreaAime Commented Dec 12, 2022 at 9:06

1 Answer 1

0

Reproduced on a 2.23.x (dev series) but with a completely different stack trace (the one that I was expecting to see, without "org.geotools.geojson" in the stack trace):

org.geoserver.wps.WPSException: Failed to retrieve value for input cropShape at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:98) at org.geoserver.wps.executor.LazyInputMap.get(LazyInputMap.java:50) at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:748) at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:628) at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50) at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:222) at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:191) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.NullPointerException at com.bedatadriven.jackson.datatype.jts.serialization.GeometryDeserializer.deserialize(GeometryDeserializer.java:45) at com.bedatadriven.jackson.datatype.jts.serialization.GeometryDeserializer.deserialize(GeometryDeserializer.java:33) at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4650) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2831) at org.geoserver.wps.ppio.GeoJSONPPIO$Geometries.decode(GeoJSONPPIO.java:134) at org.geoserver.wps.ppio.CDataPPIO.decode(CDataPPIO.java:21) at org.geoserver.wps.executor.SimpleInputProvider.getValueInternal(SimpleInputProvider.java:81) at org.geoserver.wps.executor.AbstractInputProvider.getValue(AbstractInputProvider.java:103) at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:90) ... 11 more 

Worth reporting as a new issue at https://osgeo-org.atlassian.net/

2
  • Thanks for the update @Andrea. Can I add it myself on GEOS JIRA ? or is it restricted? Commented Dec 13, 2022 at 15:46
  • You can and you should :-D You first create an account, and then open the ticket. Commented Dec 14, 2022 at 8:31

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.