Hello,

I'm trying to parse the following xml response returned by geoserver.
But a java.lang.ArrayIndexOutOfBoundsException  exception is thrown in
DocumentFactory.getInstance method. I have gt2-xml-2.4.1.jar in my
classpath.

my code:
Object doc = DocumentFactory.getInstance(tempFile.toURI(),hints,Level.WARNING); 

tempFile content:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns="http://www.opengis.net/wfs";
        xmlns:wfs="http://www.opengis.net/wfs"; 
xmlns:eai="http://www.easysdi.org/eai";
        xmlns:gml="http://www.opengis.net/gml";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://www.easysdi.org/eai
http://localhost:8080/geoserver/wfs?service=WFS&amp;version=1.0.0&amp;request=DescribeFeatureType&amp;typeName=eai:gis_cache_unit
http://www.opengis.net/wfs
http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd";>
        <gml:boundedBy>
                <gml:null>unknown</gml:null>
        </gml:boundedBy>
        <gml:featureMember>
                <eai:gis_cache_unit fid="gis_cache_unit.11254233">
                        <eai:unit_guid>TDSS00439000041AK</eai:unit_guid>
                        <eai:_geom_point_sample>
                                <gml:MultiPoint 
srsName="http://www.opengis.net/gml/srs/epsg.xml#2169";>
                                        <gml:pointMember>
                                                <gml:Point>
                                                        <gml:coordinates 
xmlns:gml="http://www.opengis.net/gml";
                                                                decimal="." 
cs="," ts="
">88103.73989463,100132.08109186</gml:coordinates>
                                                </gml:Point>
                                        </gml:pointMember>
                                </gml:MultiPoint>
                        </eai:_geom_point_sample>
                </eai:gis_cache_unit>
        </gml:featureMember>
</wfs:FeatureCollection>


Exception thrown:

java.lang.ArrayIndexOutOfBoundsException: 0
        at 
org.geotools.xml.gml.GMLComplexTypes$AbstractFeatureCollectionType.getCollection(GMLComplexTypes.java:4686)
        at 
org.geotools.xml.gml.GMLComplexTypes$AbstractFeatureCollectionType.getValue(GMLComplexTypes.java:4646)
        at 
org.geotools.xml.wfs.WFSBasicComplexTypes$FeatureCollectionType.getValue(WFSBasicComplexTypes.java:661)
        at 
org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:185)
        at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:265)
        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.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
        at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:277)
        at 
org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:108)

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to