Hi, You are sure you are using GeoTools 2.5.2? The line number of that stack trace does not quite line up.
Regardless, my best guess is that the problem lies in the schemaLocation attribute (if there is one). Is there any way you can make the xml document available? -Justin cyberrob wrote: > I'm trying to use the example posted on GeoTools user guide > <http://docs.codehaus.org/display/GEOTDOC/GML+XML+Support#GMLXMLSupport-Parsing> > > 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: Got an > java.lang.ArrayIndexOutOfBoundsException when parsing single GML file > <http://n2.nabble.com/Got-an-java.lang.ArrayIndexOutOfBoundsException-when-parsing-single-GML-file-tp2180098p2180098.html> > Sent from the geotools-devel mailing list archive > <http://n2.nabble.com/geotools-devel-f1943436.html> 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 -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. ------------------------------------------------------------------------------ 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