Hi,

Retrieving features from a WFS, my process stop on empty date with


May 27, 2016 6:00:43 PM org.geotools.xml.XMLSAXHandler processException
SEVERE: Could not parse the Date ''
 org.geotools.xml.xsi.XSISimpleTypes$Date.getValue(XSISimpleTypes.java:1176)

org.geotools.xml.handlers.SimpleElementHandler.endElement(SimpleElementHandler.java:125)
    org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:264)
    org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)

org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)

org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:134)

org.geotools.data.wfs.v1_0_0.WFSFeatureReader.run(WFSFeatureReader.java:125)

May 27, 2016 6:00:43 PM org.geotools.xml.XMLSAXHandler endElement
WARNING: Could not parse the Date ''
May 27, 2016 6:00:43 PM org.geotools.xml.XMLSAXHandler endElement
WARNING: Line 230101 Col 36



The feature model is
<element name="SISMER_prelevements" type="ms:SISMER_prelevementsType"
substitutionGroup="gml:_Feature"/>
<complexType name="SISMER_prelevementsType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="msGeometry" type="gml:GeometryPropertyType" minOccurs="0"
maxOccurs="1"/>
<element name="OPE_COPE" minOccurs="0" type="integer"/>
<element name="OPE_NOM" minOccurs="0" type="string"/>
<element name="PNT_DATE" minOccurs="0" type="date"/>
...



for null date, getValue return null but empty ones will trigger the
exception. Related to:

https://github.com/geotools/geotools/blob/master/modules/library/xml/src/main/java/org/geotools/xml/xsi/XSISimpleTypes.java#L1172

Should empty dates be checked and null returned ? or is this (returning
null for empty) supposed to be done by the WFS server ?
If not, any example to catch this kind of exception and continue processing
next features ?

Thanks.

Francois
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to