geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
412 stars 487 forks source link

WFS harvester NullPointerException #7541

Open IceflowRE opened 9 months ago

IceflowRE commented 9 months ago

Describe the bug I tried to harvest from https://geodienste.hamburg.de/HH_WFS_INSPIRE_ALKIS? with WFS 1.1.0 (when is WFS 2.0 support comming?).

Expected behavior Do not fail.

Log file

2023-12-06T13:04:27,709+0000 INFO  [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] - Starting harvesting of https://geodienste.hamburg.de/HH_WFS_INSPIRE_ALKIS?
2023-12-06T13:04:27,718+0000 INFO  [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] - Started harvesting from node : https://geodienste.hamburg.de/HH_WFS_INSPIRE_ALKIS? (OgcWxSHarvester)
2023-12-06T13:04:27,718+0000 INFO  [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] - Retrieving remote metadata information for : https://geodienste.hamburg.de/HH_WFS_INSPIRE_ALKIS?
2023-12-06T13:04:27,971+0000 WARN  [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] - Raised exception while harvesting from : https://geodienste.hamburg.de/HH_WFS_INSPIRE_ALKIS? (OgcWxSHarvester)
2023-12-06T13:04:27,971+0000 WARN  [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] -  (C) Class   : NullPointerException
2023-12-06T13:04:27,971+0000 WARN  [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] -  (C) Message : Failed to create a Document for [[Text: ???]]
2023-12-06T13:04:27,971+0000 ERROR [https_geodienste_hamburg_de_HH_WFS_INSPIRE_ALKIS_] - Failed to create a Document for [[Text: ???]]
java.lang.NullPointerException: Failed to create a Document for [[Text: ???]]
    at org.fao.geonet.utils.Xml.transform(Xml.java:391)
    at org.fao.geonet.kernel.harvest.harvester.ogcwxs.Harvester.buildServiceRecordFromCapabilities(Harvester.java:463)
    at org.fao.geonet.kernel.harvest.harvester.ogcwxs.Harvester.addMetadata(Harvester.java:334)
    at org.fao.geonet.kernel.harvest.harvester.ogcwxs.Harvester.harvest(Harvester.java:244)
    at org.fao.geonet.kernel.harvest.harvester.ogcwxs.OgcWxSHarvester.doHarvest(OgcWxSHarvester.java:78)
    at org.fao.geonet.kernel.harvest.harvester.AbstractHarvester$HarvestWithIndexProcessor.process(AbstractHarvester.java:647)
    at org.fao.geonet.kernel.harvest.harvester.AbstractHarvester.harvest(AbstractHarvester.java:718)
    at org.fao.geonet.kernel.harvest.harvester.HarvesterJob.execute(HarvesterJob.java:69)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

I replaced the actual text with question marks as it would be too verbose.

Desktop (please complete the following information):

josegar74 commented 8 months ago

I think the issue is related to this namespace in the Capabilities document: xmlns="http://www.opengis.net/wfs/2.0", while the xslt to process the file expects:

https://github.com/geonetwork/core-geonetwork/blob/5fb3196504757c2f757245f452644a5c66de258b/schemas/iso19139/src/main/plugin/iso19139/convert/OGCWxSGetCapabilitiesto19119/OGCWxSGetCapabilities-to-19119.xsl#L42