WPS processes can't read referenced WFS services

Description

See https://gis.stackexchange.com/questions/345675/geoserver-wps-request-failed-to-retrieve-value-for-input-geom for initial report.

Passing in a WFS url as input to `geo:buffer` such as http://localhost:8080/geoserver/zoomstack/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=zoomstack%3Aairports-gpk&maxFeatures=50&outputFormat=text/xml;%20subtype=gml/3.1.1 or http://localhost:8080/geoserver/zoomstack/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=zoomstack%3Aairports-gpk&maxFeatures=50&outputFormat=json gives the following errors

2019-12-20 17:55:41,351 WARN [org.geoserver.wps.executor] - Failed to retrieve value for input geom
java.lang.IllegalArgumentException: Decoded result is not a org.locationtech.jts.geom.Geometry, got a: org.geotools.gml3.bindings.DelayedSchemaFeatureCollection
at org.geoserver.wps.executor.RemoteRequestInputProvider.getValueInternal(RemoteRequestInputProvider.java:217)
at org.geoserver.wps.executor.AbstractInputProvider.getValue(AbstractInputProvider.java:100)
at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:89)
at org.geoserver.wps.executor.LazyInputMap.get(LazyInputMap.java:49)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:740)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:620)
at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:227)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:195)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:748)
2019-12-20 17:55:41,351 ERROR [org.geoserver.wps.executor] - Process execution failed
org.geoserver.wps.WPSException: Failed to retrieve value for input geom
at org.geoserver.wps.executor.RemoteRequestInputProvider.getValueInternal(RemoteRequestInputProvider.java:229)
at org.geoserver.wps.executor.AbstractInputProvider.getValue(AbstractInputProvider.java:100)
at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:89)
at org.geoserver.wps.executor.LazyInputMap.get(LazyInputMap.java:49)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:740)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:620)
at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:227)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:195)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:748)

Oddly, it also fails for a JSON payload:

2019-12-20 17:56:16,569 WARN [org.geoserver.wps.executor] - Failed to retrieve value for input geom
java.lang.RuntimeException: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureCollectionHandler.<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(Unknown Source)
at org.json.simple.parser.JSONParser.parse(Unknown Source)
at org.geotools.geojson.GeoJSONUtil.parse(GeoJSONUtil.java:260)
at org.geotools.geojson.geom.GeometryJSON.parse(GeometryJSON.java:623)
at org.geotools.geojson.geom.GeometryJSON.read(GeometryJSON.java:181)
at org.geotools.geojson.geom.GeometryJSON.read(GeometryJSON.java:193)
at org.geoserver.wps.ppio.GeoJSONPPIO$Geometries.decode(GeoJSONPPIO.java:79)
at org.geoserver.wps.executor.RemoteRequestInputProvider.getValueInternal(RemoteRequestInputProvider.java:207)
at org.geoserver.wps.executor.AbstractInputProvider.getValue(AbstractInputProvider.java:100)
at org.geoserver.wps.executor.LazyInputMap.parseInputs(LazyInputMap.java:89)
at org.geoserver.wps.executor.LazyInputMap.get(LazyInputMap.java:49)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:740)
at org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:620)
at org.geoserver.wps.executor.ProcessStartupFilter$ProcessStartupWrapper.execute(ProcessStartupFilter.java:50)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:227)
at org.geoserver.wps.executor.DefaultProcessManager$ProcessCallable.call(DefaultProcessManager.java:195)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:748)
Caused by: java.lang.NoSuchMethodException: org.geotools.geojson.feature.FeatureCollectionHandler.<init>(org.locationtech.jts.geom.GeometryFactory)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at org.geotools.geojson.DelegatingHandler.createDelegate(DelegatingHandler.java:119)
... 21 more

Environment

None

Assignee

Unassigned

Reporter

Ian Turton

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure