WPS tasks that result in a FeatureCollection of the specified type (such as gs:Nearest) fail with a NullPointerException if the geometry column is named "location".
Our spatial DB is Postgres 9.1.4-3/PostGIS 2.6.6-2.2.
Issuing a WPS "gs:Nearest" query against a layer with a geometry column named "location" results in the attached stacktrace.
Workaround: Change the column name to anything else and refresh the layer.