When requesting features as JSON java.lang.ClassCastException is thrown:
java.lang.ClassCastException: class [Ljava.lang.String; cannot be cast to class java.lang.String ([Ljava.lang.String; and java.lang.String are in module java.base of loader 'bootstrap')
at org.geoserver.wfs.GetFeature.lambda$mapValuesToStrings$3(GetFeature.java:1067)
at java.base/java.util.stream.Collectors.lambda$toMap$68(Collectors.java:1666)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1764)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at org.geoserver.wfs.GetFeature.mapValuesToStrings(GetFeature.java:1064)
at org.geoserver.wfs.GetFeature.buildResults(GetFeature.java:1051)
at org.geoserver.wfs.GetFeature.run(GetFeature.java:649)
at org.geoserver.ogcapi.features.FeatureService.items(FeatureService.java:367)
...
In org.geoserver.wfs.GetFeature:1067 values are casted to String:
(String) e.getValue()
I will provide a PR, which changes this to:
String.valueOf(e.getValue())
|