[Geoserver-devel] [jira] Created: (GEOS-1229) Insert fails because of GML formatting

Insert fails because of GML formatting
--------------------------------------

                 Key: GEOS-1229
                 URL: http://jira.codehaus.org/browse/GEOS-1229
             Project: GeoServer
          Issue Type: Bug
          Components: WFS
    Affects Versions: 1.6.0-beta2
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira
             Fix For: 1.6.0-rc1

The following insert fails:

{code}
<wfs:Transaction service="WFS" version="1.1.0" xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:gml="http://www.opengis.net/gml&quot; xmlns:sf="http://cite.opengeospatial.org/gmlsf&quot;
  xmlns:topp="http://www.openplans.org/topp&quot;&gt;
  <wfs:Insert handle="insert-1">
    <topp:coastline gml:id="coastline.1">
      <gml:boundedBy>
        <gml:Envelope srsName="urn:x-ogc:def:crs:EPSG:6.11.2:3031">
          <gml:lowerCorner>-2290659.02568378 2304522.61820067</gml:lowerCorner>
          <gml:upperCorner>-2272982.7639574 2321608.0</gml:upperCorner>
        </gml:Envelope>
      </gml:boundedBy>
      <topp:fnode_>1</topp:fnode_>
      <topp:tnode_>1</topp:tnode_>
      <topp:lpoly_>1</topp:lpoly_>
      <topp:rpoly_>2</topp:rpoly_>
      <topp:length>80887.979783424</topp:length>
      <topp:coast10_>1</topp:coast10_>
      <topp:coast10_id>527</topp:coast10_id>
      <topp:cst10typ>22011</topp:cst10typ>
      <topp:feature_ty>Coastline</topp:feature_ty>
      <topp:certainty>Definite</topp:certainty>
      <topp:certainty_>1029</topp:certainty_>
      <topp:certain_01>2</topp:certain_01>
      <topp:coast_a_01>1272</topp:coast_a_01>
      <topp:coast_a_02>0</topp:coast_a_02>
      <topp:the_geom>
        <gml:Curve srsName="urn:x-ogc:def:crs:EPSG:6.11.2:3031">
          <gml:segments>
            <gml:LineStringSegment interpolation="linear">
              <gml:posList>
                -2277644.0 2321608.0 -2274007.63645483 2321571.6923812 -2272982.7639574
                2321220.84983015 -2276779.98623007 2319215.26491011 -2277171.58919488
                2318418.51097483 -2276869.95550597 2315246.85510884 -2277111.3653779
                2314325.53125323 -2278411.25625211 2312697.17242218 -2282481.09266276
                2308988.79440581 -2283267.18516939 2307790.20087065 -2282770.30095296
                2307487.14196677 -2279205.05030396 2307224.88270065 -2279187.91893547
                2306413.3606636 -2279772.48025827 2305240.20878574 -2280531.85416709
                2304522.61820067 -2281245.10661702 2304756.20519295 -2283707.34931662
                2306975.33057109 -2284427.89504062 2306804.13820872 -2285783.66409421
                2305055.82094398 -2288042.20257383 2305269.55416915 -2290659.02568378
                2306212.88604276 -2286657.81612991 2306355.4664049 -2285171.17239786
                2307679.12845195 -2283972.63216661 2309571.76244501 -2283553.41561374
                2311415.77896442 -2283945.37512669 2312281.39634474 -2287218.66746127
                2315378.20389471 -2287080.47892666 2315585.9801674 -2282853.79404272
                2314017.85557203 -2281862.62773486 2313806.71110972 -2281334.58136216
                2314052.6078468 -2281702.2475802 2317295.64154046 -2279921.72380841 2318460.09948424
                -2282486.5197332 2319934.52194548 -2282815.57450135 2321350.68858032
                -2280776.94794276 2319445.48235311 -2279975.5856496 2319579.97088144 -2277644.0
                2321608.0
              </gml:posList>
            </gml:LineStringSegment>
          </gml:segments>
        </gml:Curve>
      </topp:the_geom>
      <topp:dt>2007-07-02T12:06:37.671+02:00</topp:dt>
      <topp:timetest>15:48:50</topp:timetest>
      <topp:datetest>2007-07-03+00:00</topp:datetest>
    </topp:coastline>
  </wfs:Insert>
</wfs:Transaction>
{code}

This happens because Eclipse formatted the XML so that coordinates are split on separate lines and the parser apparently gets out empty elements out of the string split:

{code}
aused by: java.lang.RuntimeException: Parsing failed for null: java.lang.NumberFormatException: empty String
  at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:145)
  at org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:197)
  at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:163)
  at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:167)
  at org.geotools.xml.impl.ParseExecutor.preParse(ParseExecutor.java:259)
  at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:105)
  ... 57 more
Caused by: java.lang.NumberFormatException: empty String
  at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
  at java.lang.Double.valueOf(Double.java:447)
  at java.lang.Double.<init>(Double.java:539)
  at org.geotools.xs.bindings.XSDoubleBinding.parse(XSDoubleBinding.java:101)
  at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:131)
  ... 62 more
{code}

Reformatting the insert by removing the newlines make it work fine (after the xstimebinding bug is fixed, of course)

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira