I was finally able to reproduce this in a unit test.  It looks like one of
the geoprocessing routines I created, is adding a LinearRing that has no
coordinates.  So when I serialize the feature to GML for transport, I have a
LinearRing section that looks like this:

<gml:innerBoundaryIs>
            <gml:LinearRing>
              <gml:coordinates xmlns:gml="http://www.opengis.net/gml";
decimal="." cs="," ts=" "/>
            </gml:LinearRing>
          </gml:innerBoundaryIs>

It looks like Xerces will treat the content of coordinates as a String,
because there are no coordinates.

I'm looking into what dependency is causing this behavior in case you are
interested.

On Thu, Apr 16, 2009 at 9:55 AM, Ryan Moquin <[email protected]> wrote:

> Hello,
>
> Out of the blue, I have started getting ClassCastExceptions when Geotools
> is trying to parse a LinearRing from GML.  This used to work in my setup, I
> haven't changed XML parsers or anything that I can think of that might be
> related...  Can anyone give me any suggestions from this stack trace?  It
> seems like something may have changed under the covers with my XML parser,
> even though I haven't made any library changes to my web application...
>
> Caused by: java.lang.RuntimeException: Parsing failed for LinearRing:
> java.lang.ClassCastException: java.lang.String cannot be cast to
> com.vividsolutions.jts.geom.CoordinateSequence
>     at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:158)
>     at
> org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:208)
>     at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:174)
>     at
> org.geotools.xml.impl.ElementHandlerImpl.endElement(ElementHandlerImpl.java:222)
>     at
> org.geotools.xml.impl.ParserHandler.endElement(ParserHandler.java:582)
>     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.geotools.xml.Parser.parse(Parser.java:180)
>     at org.geotools.xml.Parser.parse(Parser.java:158)
>
> Thanks for any suggestions!
>
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to