Details
-
Type:
Bug
-
Status:
Analysis
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: UDIG 1.1.M7
-
Fix Version/s: UDIG 1.4.1
-
Component/s: webservices
-
Labels:None
-
Environment:XP, JRE 1.5
Description
"SAXException: Too many decimal places" exception is raised on uDig client when processing info data for a feature. (too large IDs or attributes?)
Server Response:
<?xml version='1.0' encoding='utf-8'?>
<wfs:FeatureCollection
xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ber="http://www.x.com/ber"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
http://localhost:8813/WebFeatureService?version=1.0.0&service=WFS&request=DescribeFeatureType&typename=ftf_22080
http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy> <gml:null>unknown</gml:null> </gml:boundedBy>
<gml:featureMember>
<ber:ftf_22080 sid="8209354515409933955850626" updatedBy="" longTransactionId="" createdBy="-1"
createDate="2006-03-07" updateDate="" permittedOperations="update delete"
id="52205650787946457780281730">
<ber:at_26042>Druh</ber:at_26042>
<ber:at_26040>652</ber:at_26040>
<ber:at_26041>Elektr</ber:at_26041>
<ber:at_26001>2545</ber:at_26001>
<ber:at_26071>406446400000000000360</ber:at_26071>
...
=================================
Additional info
The exception is thrown when trying to parse large attributes in WFS response like:
<ber:at_26071>406446400000000000360</ber:at_26071>
Where attribute is defined(DesctibeFeatureType) as:
<xsd:element name="at_26071" nillable="true" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="38"/>
<xsd:fractionDigits value="0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
There is no restriction in WFS1.0 specification for decimal length, however it could be good to check the data type and consider using java.math.BigDecimal or other suitable data type.
Exception stack:
java.io.IOException: org.xml.sax.SAXException: Too many decimal places
at org.geotools.xml.gml.FCBuffer.hasNext(FCBuffer.java:305)
at org.geotools.data.wfs.WFSFeatureReader.loadElement(WFSFeatureReader.java:170)
at org.geotools.data.wfs.WFSFeatureReader.hasNext(WFSFeatureReader.java:154)
at org.geotools.data.wfs.WFSDataStore.getFeatureReader(WFSDataStore.java:749)
at org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:147)
at net.refractions.udig.tool.info.internal.DataStoreDescribeLayer.info2(DataStoreDescribeLayer.java:71)
at net.refractions.udig.tool.info.internal.InfoView2.searchImplementation(InfoView2.java:190)
at net.refractions.udig.ui.SearchPart$1.run(SearchPart.java:472)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: org.xml.sax.SAXException: Too many decimal places
at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:230)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140)
at org.geotools.data.wfs.WFSFeatureReader.run(WFSFeatureReader.java:124)