[Geoserver-devel] WFS-t:insert line correct but got trouble when Insert point

<wfs:Transaction service=“WFS” version=“1.0.0”
xmlns:wfs=“http://www.opengis.net/wfs
xmlns:topp=“http://www.openplans.org/topp
xmlns:gml=“http://www.opengis.net/gml
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:tasmania_state_boundaries”>
wfs:Insert
topp:tasmania_state_boundaries
<gml:Point srsName=“http://www.opengis.net/gml/srs/epsg.xml#4326”>
<gml:coordinates decimal=“.” cs=“,” ts=" ">147.7,-42.1800</gml:coordinates>
</gml:Point>
</topp:tasmania_state_boundaries>
</wfs:Insert>
</wfs:Transaction>

I send this WFS to Geoserver,why i always got this kind of error:

<?xml version="1.0" ?>

-

java.lang.ArrayIndexOutOfBoundsException: -1 at org.vfny.geoserver.wfs.requests.TransactionFeatureHandler.geometry(TransactionFeatureHandler.java:383) at org.geotools.gml.GMLFilterGeometry.geometryEnd(GMLFilterGeometry.java:102) at org.geotools.gml.GMLFilterDocument.endElement(GMLFilterDocument.java:253) at org.xml.sax.helpers.ParserAdapter.endElement(ParserAdapter.java:626) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.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.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:405) at org.vfny.geoserver.wfs.requests.readers.TransactionXmlReader.read(TransactionXmlReader.java:66) at org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:375) at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doResponse(WfsDispatcher.java:286) at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doPost(WfsDispatcher.java:175) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)

but if i insert line it could work:

<wfs:Transaction service=“WFS” version=“1.0.0”
xmlns:wfs=“http://www.opengis.net/wfs
xmlns:topp=“http://www.openplans.org/topp
xmlns:gml=“http://www.opengis.net/gml
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:tasmania_roads

wfs:Insert
topp:tasmania_roads
topp:the_geom
<gml:MultiLineString srsName=“http://www.opengis.net/gml/srs/epsg.xml#4326”>
gml:lineStringMember
gml:LineString
<gml:coordinates decimal=“.” cs=“,” ts=" ">
147.522247,-41.859921 147.541656,-42.217743
</gml:coordinates>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</topp:the_geom>
</topp:tasmania_roads>
</wfs:Insert>
</wfs:Transaction>

Well the state boundaries layer is not a point layer, it's a polygon layer. I think a point should work fine if you're inserting in to the tasmania city layers, for example. Though I agree we should have a nicer error message for that insert, an array out of bounds index is not good.

best regards,

Chris

fang.chen@anonymised.com wrote:

<wfs:Transaction service="WFS" version="1.0.0"
   xmlns:wfs="http://www.opengis.net/wfs&quot;
   xmlns:topp="http://www.openplans.org/topp&quot;
   xmlns:gml="http://www.opengis.net/gml&quot;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation="http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:tasmania_state_boundaries&quot;&gt;

   <wfs:Insert>
     <topp:tasmania_state_boundaries> <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
               <gml:coordinates decimal="." cs="," ts=" ">147.7,-42.1800</gml:coordinates>
         </gml:Point> </topp:tasmania_state_boundaries>
   </wfs:Insert>
</wfs:Transaction>

I send this WFS to Geoserver,why i always got this kind of error:

* * <?xml version="1.0" ?>
*-* <#> <ServiceExceptionReport version="*1.2.0*" xmlns="*http://www.opengis.net/ogc*&quot; xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*&quot; xsi:schemaLocation="*http://www.opengis.net/ogc http://localhost:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd*&quot;&gt;
* * <ServiceException>*java.lang.ArrayIndexOutOfBoundsException: -1 at org.vfny.geoserver.wfs.requests.TransactionFeatureHandler.geometry(TransactionFeatureHandler.java:383) at org.geotools.gml.GMLFilterGeometry.geometryEnd(GMLFilterGeometry.java:102) at org.geotools.gml.GMLFilterDocument.endElement(GMLFilterDocument.java:253) at org.xml.sax.helpers.ParserAdapter.endElement(ParserAdapter.java:626) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.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.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:405) at org.vfny.geoserver.wfs.requests.readers.TransactionXmlReader.read(TransactionXmlReader.java:66) at org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:375) at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doResponse(WfsDispatcher.java:286) at org.vfny.geoserver.wfs.servlets.WfsDispatcher.doPost(WfsDispatcher.java:175) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)*</ServiceException>
* * </ServiceExceptionReport>

but if i insert line it could work:

<wfs:Transaction service="WFS" version="1.0.0"
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:topp="http://www.openplans.org/topp&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:tasmania_roads&quot;

>
  <wfs:Insert>
    <topp:tasmania_roads>
      <topp:the_geom>
        <gml:MultiLineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:lineStringMember>
            <gml:LineString>
              <gml:coordinates decimal="." cs="," ts=" ">
147.522247,-41.859921 147.541656,-42.217743
              </gml:coordinates>
            </gml:LineString>
          </gml:lineStringMember>
        </gml:MultiLineString>
      </topp:the_geom>
    </topp:tasmania_roads>
  </wfs:Insert>
</wfs:Transaction>
!DSPAM:1003,44d0bab5289207785049143!

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

!DSPAM:1003,44d0bab5289207785049143!

------------------------------------------------------------------------

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1003,44d0bab5289207785049143!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org