I'm trying to use the example posted on 
http://docs.codehaus.org/display/GEOTDOC/GML+XML+Support#GMLXMLSupport-Parsing
GeoTools user guide 

But I always get a java.lang.ArrayIndexOutOfBoundsException at the line :

FeatureCollection fc = (FeatureCollection) parser.parse( gml );

It seems error happened before the casting, but I cant figure how to solve
it..Or is there any other project config missing in my eclipse??

Plz help!! Thx~

btw,my gml file is transformed from shp files using ogr2ogr2 cmd.


Here's log:

Welcome to GeoTools:2.5.2
java.lang.ArrayIndexOutOfBoundsException: 1
        at 
org.geotools.xml.impl.ParserHandler.startElement(ParserHandler.java:261)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
        at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.geotools.xml.Parser.parse(Parser.java:185)
        at org.geotools.xml.Parser.parse(Parser.java:147)
        at org.geotools.demo.parseGML.main(parseGML.java:34)
-- 
View this message in context: 
http://n2.nabble.com/Got-an-java.lang.ArrayIndexOutOfBoundsException-when-parsing-single-GML-file-tp2180098p2180098.html
Sent from the geotools-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to