This is a regression from the following commit that got missed because the bug 
wasn't covered by existing unit tests:
https://github.com/geoserver/geoserver/commit/587768dfcbe166bbf7972d172f454f1b3f17a043#diff-cb964c0310e4da804603b89cac17d51824cc66e2f626c4af6902610c8a8e9329

Getting rid of the JsonParser/JsonFactory stuff and just calling 
MAPPER.readValue(input, Geometry.class); should work.

Steve Ikeoka
________________________________
From: Roar Brænden <roar.brenden...@gmail.com>
Sent: Wednesday, November 1, 2023 7:09 AM
To: Jody Garnett <jody.garn...@gmail.com>
Cc: geoserver-users@lists.sourceforge.net 
<geoserver-users@lists.sourceforge.net>
Subject: Re: [Geoserver-users] ReprojectGeometry WPS problem from 2.22.0 
GeoServer version using application/json input

Hi, Jody, that code has been copied into GeoTools codebase in the module 
gt-geojson-core. https: //github. 
com/geotools/geotools/blob/main/modules/unsupported/geojson-core/src/main/java/com/bedatadriven/jackson/datatype/jts/serialization/GeometryDeserializer.
 javaAnd,
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
If you think this is a phishing email report it using the report phish button. 
For additional assistance go to OneGDIT Service Center KB0030624

ZjQcmQRYFpfptBannerEnd
Hi,

Jody, that code has been copied into GeoTools codebase in the module 
gt-geojson-core.

https://github.com/geotools/geotools/blob/main/modules/unsupported/geojson-core/src/main/java/com/bedatadriven/jackson/datatype/jts/serialization/GeometryDeserializer.java<https://urldefense.us/v3/__https://github.com/geotools/geotools/blob/main/modules/unsupported/geojson-core/src/main/java/com/bedatadriven/jackson/datatype/jts/serialization/GeometryDeserializer.java__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMQ889R1U$>

And, the lines 44-45 were the error occurs is as follows:

ObjectCodec oc = jsonParser.getCodec();
JsonNode root = oc.readTree(jsonParser);

Here oc is the troublemaker being null, but according to the docs of getCodec() 
that could be the case so it should be handled in a way or the other. I'm 
afraid I haven't really looked into this module, so I can't really say how it 
should be handled.

Regards,
Roar Brænden


31. okt. 2023 kl. 21:55 skrev Jody Garnett 
<jody.garn...@gmail.com<mailto:jody.garn...@gmail.com>>:

I am a bit confused, checking GeometryDeserializer.java line 45:


  *   
https://github.com/bedatadriven/jackson-datatype-jts/blob/master/src/main/java/com/bedatadriven/jackson/datatype/jts/serialization/GeometryDeserializer.java<https://urldefense.us/v3/__https://github.com/bedatadriven/jackson-datatype-jts/blob/master/src/main/java/com/bedatadriven/jackson/datatype/jts/serialization/GeometryDeserializer.java__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMEW3S0vg$>

And line 45 does not exist ... huh.

I looked online for a bit and did not find 
com.bedatadriven.jackson.datatype.jts.serialization.GeometryDeserializer yet 
(maybe someone else can help?)

I assume it is trying to parse GeoJSON when the failure occurs, perhaps look at 
the json output for anything odd or missing?
--
Jody Garnett


On Oct 31, 2023 at 1:53:06 AM, Daniele Maggiolo via Geoserver-users 
<geoserver-users@lists.sourceforge.net<mailto:geoserver-users@lists.sourceforge.net>>
 wrote:

Hi,

I noticed that from version 2.22.0 of GeoServe, running the WPS process 
“gs:RepojectGeometry” with application/json input no longer works correctly 
while, for example, with version 2.18.2 everything worked correctly.

I tried with several recent versions, up to 2.23.1.

The Java version used in the latest versions is 11 as recommended by the 
minimum requirements of GeoServer (in version 2.18.2 I used version 8).

If I test the process with WKT input, everything works fine, while if I use 
application/json, I get the following error:



31 Oct 09:48:28 ERROR  [wps.executor] - Process execution failed

org.geoserver.wps.WPSException: Failed to retrieve value for input geometry

               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.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:829)

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)



The XML to test the functionality is as follows:



<?xml version="1.0" encoding="UTF-8"?><wps:Execute version="1.0.0" 
service="WPS" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance<https://urldefense.us/v3/__http://www.w3.org/2001/XMLSchema-instance__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMN20OuYg$>"
 
xmlns="http://www.opengis.net/wps/1.0.0<https://urldefense.us/v3/__http://www.opengis.net/wps/1.0.0__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMGSzwEI0$>"
 
xmlns:wfs="http://www.opengis.net/wfs<https://urldefense.us/v3/__http://www.opengis.net/wfs__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMV0Carno$>"
 
xmlns:wps="http://www.opengis.net/wps/1.0.0<https://urldefense.us/v3/__http://www.opengis.net/wps/1.0.0__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMGSzwEI0$>"
 
xmlns:ows="http://www.opengis.net/ows/1.1<https://urldefense.us/v3/__http://www.opengis.net/ows/1.1__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMotbtM0s$>"
 
xmlns:gml="http://www.opengis.net/gml<https://urldefense.us/v3/__http://www.opengis.net/gml__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMh5ePlik$>"
 
xmlns:ogc="http://www.opengis.net/ogc<https://urldefense.us/v3/__http://www.opengis.net/ogc__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBM10f1qc0$>"
 
xmlns:wcs="http://www.opengis.net/wcs/1.1.1<https://urldefense.us/v3/__http://www.opengis.net/wcs/1.1.1__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBM5D4dL9U$>"
 
xmlns:xlink="http://www.w3.org/1999/xlink<https://urldefense.us/v3/__http://www.w3.org/1999/xlink__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMUZeBZ7o$>"
 
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0<https://urldefense.us/v3/__http://www.opengis.net/wps/1.0.0__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMGSzwEI0$>
 
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd<https://urldefense.us/v3/__http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMTqTGR-4$>">

  <ows:Identifier>gs:ReprojectGeometry</ows:Identifier>

  <wps:DataInputs>

    <wps:Input>

      <ows:Identifier>geometry</ows:Identifier>

      <wps:Data>

        <wps:ComplexData 
mimeType="application/json"><![CDATA[{"type":"Point","coordinates":[1293046.99,5729442.56]}]]></wps:ComplexData>

      </wps:Data>

    </wps:Input>

    <wps:Input>

      <ows:Identifier>sourceCRS</ows:Identifier>

      <wps:Data>

        <wps:LiteralData>EPSG:3857</wps:LiteralData>

      </wps:Data>

    </wps:Input>

    <wps:Input>

      <ows:Identifier>targetCRS</ows:Identifier>

      <wps:Data>

        <wps:LiteralData>EPSG:3003</wps:LiteralData>

      </wps:Data>

    </wps:Input>

  </wps:DataInputs>

  <wps:ResponseForm>

    <wps:RawDataOutput mimeType="application/json">

      <ows:Identifier>result</ows:Identifier>

    </wps:RawDataOutput>

  </wps:ResponseForm>

</wps:Execute>




Daniele Maggiolo

Settore Tecnico



<image001.png>



Via Roma, 5 – 36026, Pojana Maggiore (VI)

Tel. 0444 794127 – 
www.abitat.it<https://urldefense.us/v3/__http://www.abitat.it/__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMLpPc3wM$>



La presente e-mail ha carattere esclusivamente aziendale. Personale incaricato 
della ditta Abitat SIT srl potrà accedere al contenuto della e-mail e a 
eventuali risposte. Non è consentita la diffusione, distribuzione e copia della 
e-mail da parte di persona diversa dal destinatario. Non permettendo Internet 
di assicurare l'integrità del presente messaggio si declina ogni responsabilità 
nell'ipotesi in cui esso venga modificato. Se avete ricevuto questa e-mail per 
errore vi preghiamo di eliminarla e darne comunicazione al mittente. Grazie per 
la Vostra collaborazione.


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/<https://urldefense.us/v3/__http://www.ianturton.com/talks/foss4g.html*/__;Iw!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBM7QAGMqc$>
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html<https://urldefense.us/v3/__http://geoserver.org/comm/userlist-guidelines.html__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMHM38tdQ$>

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer<https://urldefense.us/v3/__https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMK8eN2QE$>


Geoserver-users@lists.sourceforge.net<mailto:Geoserver-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-users<https://urldefense.us/v3/__https://lists.sourceforge.net/lists/listinfo/geoserver-users__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMzVJo8Fg$>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/<https://urldefense.us/v3/__http://www.ianturton.com/talks/foss4g.html*/__;Iw!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBM7QAGMqc$>
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html<https://urldefense.us/v3/__http://geoserver.org/comm/userlist-guidelines.html__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMHM38tdQ$>

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer<https://urldefense.us/v3/__https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMK8eN2QE$>


Geoserver-users@lists.sourceforge.net<mailto:Geoserver-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-users<https://urldefense.us/v3/__https://lists.sourceforge.net/lists/listinfo/geoserver-users__;!!JRQnnSFuzw7wjAKq6ti6!waRT-HUsgXcJEg3ALCJmXmJtfMs6nxH56GWmlojRNdIWR-CI-lBT4m5Qk_Z7YEKMBuVB7daUH4bQZvyk3fBMzVJo8Fg$>

_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to