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 indexing not working #2498

Open RichardQZeng opened 6 years ago

RichardQZeng commented 6 years ago

Open "Filter data" and select on map layer from GeoServer, error will occur:

screenshot

Debug into the code, found something went wrong:

Uncaught Error: Element [{http://www.opengis.net/ows}ows:Get] could not be unmarshalled as the property neither allows typed objects nor DOM as content. This is a sign of invalid mappings, do not use [allowTypedObject : false] and [allowDom : false] at the same time.

at Class.unmarshalElement (Jsonix-all.js:1994)
at Class.unmarshal (Jsonix-all.js:3422)
at Class.unmarshalProperty (Jsonix-all.js:2350)
at Class.unmarshal (Jsonix-all.js:2307)
at Class.unmarshalElement (Jsonix-all.js:1979)
at Class.unmarshal (Jsonix-all.js:3043)
at Class.unmarshalProperty (Jsonix-all.js:2350)
at Class.unmarshal (Jsonix-all.js:2307)
at Class.unmarshalElement (Jsonix-all.js:1979)
at Class.unmarshal (Jsonix-all.js:3043)

unmarshalElement @ Jsonix-all.js:1994
unmarshal @ Jsonix-all.js:3422
unmarshalProperty @ Jsonix-all.js:2350
unmarshal @ Jsonix-all.js:2307
unmarshalElement @ Jsonix-all.js:1979
unmarshal @ Jsonix-all.js:3043
unmarshalProperty @ Jsonix-all.js:2350
unmarshal @ Jsonix-all.js:2307
unmarshalElement @ Jsonix-all.js:1979
unmarshal @ Jsonix-all.js:3043
unmarshalProperty @ Jsonix-all.js:2350
unmarshal @ Jsonix-all.js:2307
unmarshalElement @ Jsonix-all.js:1979
unmarshal @ Jsonix-all.js:3043
unmarshalProperty @ Jsonix-all.js:2350
unmarshal @ Jsonix-all.js:2307
unmarshalElement @ Jsonix-all.js:1979
unmarshal @ Jsonix-all.js:3043
unmarshalProperty @ Jsonix-all.js:2350
unmarshal @ Jsonix-all.js:2307
unmarshalElement @ Jsonix-all.js:1979
unmarshalDocument @ Jsonix-all.js:2116
(anonymous) @ VM204880:1
 parseWFSCapabilities @ OWSService.js:152
(anonymous) @ OWSService.js:292
(anonymous) @ angular.js:11031
processQueue @ angular.js:15627
(anonymous) @ angular.js:15643

$eval @ angular.js:16895
$digest @ angular.js:16711
$apply @ angular.js:17003
(anonymous) @ angular.js:24679
dispatch @ jquery-2.0.3.js:4676
elemData.handle @ jquery-2.0.3.js:4360

I'm using GN 3.4.x, Elasticsearch is configured and running. Can anyone poit out what to do next? Thank you!

jahow commented 6 years ago

Hi,

Could you please show us the metadata XML you used, or at least the WFS service URL? Thanks

RichardQZeng commented 6 years ago

It is a local server, the WFS URL under use is: http://localhost/geoserver/sf/wfs. "sf" is the workspace in GeoServer.

The error I found is located at OWSService.js: 152: xfsCap = unmarshaller110.unmarshalDocument(xml).value;

xfsCap is "undefined", while the input "xml" contains the the WFS capabilities which looks good. It seems unmarshaller110.unmarshalDocument is not working correctly. Sorry I can't post the detail data here.

I don't know what the supposed value of xfsCap, so I just suspect it is causing the problem.

jahow commented 6 years ago

There is indeed an error while deserializing the XML GetCapabilities document returned by the WFS service. This usually happens because the schema used for deserialization is not valid. Maybe if you gave us a copy of the XML we could try to fix the problem on our side?

RichardQZeng commented 6 years ago

I set up another test GeoServer, the error is still there. Here attached the XML data for the input of OWSService.js:292: var xfsCap = parseWFSCapabilities(data); Temp.zip The two files are for the same data, but one is the original, the other is formatted.

jahow commented 6 years ago

This should be fixed, can you try again with the most recent 3.4.x branch?

RichardQZeng commented 6 years ago

Great job! The problem is gone. Here is the screenshot:

screenshot

But there is another problem. When the message "feature not indexed" shown in the dialog, the buttons "Reset" and "Apply filter" shouldn't show up because they are for facet search. The button "Index data" should show up instead. So now there is no way to index the features.

jahow commented 6 years ago

Have you tried with an admin profile? I know this part of Geonetwork is still a bit rough, the switch to ElasticSearch induced some bugs in the mix. We have work planned for this feature soon, I'll try and fix this along the way.

RichardQZeng commented 6 years ago

Yes, I'm using an admin profile. I hacked it a little, and could see the indexing is working, although the result is still not what expected. I'll look into the code and get familiar with it, hope I can contribute something. By the way, I'm interested in the WPS module too, and notice that you did something significant on that.

Shall we leave this issue open or close it?

jahow commented 6 years ago

I guess this should stay opened as long as the minimal workflow "add WMS > request WFS indexing > filter on features > apply filter" is not functional.

If you have any questions on the WPS tool I'll be happy to help :)

juserror commented 6 years ago

Hi, there, and this is the kind of error I am getting when trying to filter data based on wms add. It corectly finds the possible data in filter data dropdown, but after selecting one of them, it responds with Unable to connect to service, error during index access.. What could be the problem here, any ideas? screenshot-2018-2-1 my geonetwork catalogue - my organization screenshot-2018-2-1 my geonetwork catalogue - my organization 1

jahow commented 6 years ago

Looks like the ES instance is not reachable. Did you start Geonetwork with the -Pes profile?