[Geoserver-users] WFS- T - INSERT (=>PostGIS), By Line / Polygon Geometry error message

hi @ all,
I am trying to insert geometries via "WFST-T - INSERT" in a PostGIS-DB.
With the Point-geometry it works fine but with a Line/Polygon geometry I get
an Error.

(Using GeoServer 1.5.4)

Request:
-------------
<wfs:Transaction version="1.0.0" service="WFS"
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:topp="http://www.openplans.org/topp&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd
  http://www.openplans.org/topp
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:geo_line&quot;&gt;
<wfs:Insert>
  <topp:geo_line>
    <bezeichnung>line digi</bezeichnung>
  <the_geom>
    <gml:MultiLineString srsName="EPSG:31467">
      <gml:lineStringMember>
        <gml:LineString>
          <gml:coordinates>3304000,5516000 3326000,5489000 3328000,5455000
3299000,5443000</gml:coordinates>
        </gml:LineString>
      </gml:lineStringMember>
    </gml:MultiLineString>
  </the_geom>
  </topp:geo_line>
</wfs:Insert>
</wfs:Transaction>

Error:
---------
<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://geoserver.lbd.rlp:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException>
    java.lang.RuntimeException: problem creating feature
    java.lang.RuntimeException: problem creating feature
    java.lang.RuntimeException: problem creating feature
    java.lang.RuntimeException: problem creating feature
  </ServiceException>
</ServiceExceptionReport>

Am I doing something wrong ?

Regards,
Greq
--
---------------------------------------
WhereGroup GmbH & Co. KG
Siemensstraße 8
53121 Bonn
Germany

Gregor Fikoczek
Email: gregor.fikoczek@anonymised.com
Fon: +49 (0)228 / 90 90 38 - 25
Fax: +49 (0)228 / 90 90 38 - 11

info@anonymised.com
www.wheregroup.com
Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Arnulf Christl, Olaf Knopp, Peter Stamm
---------------------------------------

Gregor Fikoczek ha scritto:

hi @ all, I am trying to insert geometries via "WFST-T - INSERT" in a PostGIS-DB.
With the Point-geometry it works fine but with a Line/Polygon geometry I get an Error.

(Using GeoServer 1.5.4)

Request:
-------------
<wfs:Transaction version="1.0.0" service="WFS" xmlns:gml="http://www.opengis.net/gml&quot; xmlns:topp="http://www.openplans.org/topp&quot; xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:wfs="http://www.opengis.net/wfs&quot;
  xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd
  http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:geo_line&quot;&gt;
<wfs:Insert>
  <topp:geo_line>
    <bezeichnung>line digi</bezeichnung>
  <the_geom>
    <gml:MultiLineString srsName="EPSG:31467">
      <gml:lineStringMember>
        <gml:LineString>
          <gml:coordinates>3304000,5516000 3326000,5489000 3328000,5455000 3299000,5443000</gml:coordinates>
        </gml:LineString>
      </gml:lineStringMember>
    </gml:MultiLineString>
  </the_geom>
  </topp:geo_line>
</wfs:Insert>
</wfs:Transaction>

Error:
---------
<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://geoserver.lbd.rlp:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException>
    java.lang.RuntimeException: problem creating feature
    java.lang.RuntimeException: problem creating feature </ServiceException>
</ServiceExceptionReport>

Am I doing something wrong ?

Usually this happens when an attribute you've specified is incompatible with the actual type declared in the feature type. Can you go to config/server, enable verbose exceptions, and see if the error message is any more illuminating? Alternatively, have a look in the geoserver console (if you have one) or enable file logging and see what the full stack trace is.

Cheers
Andrea

Hi Andrea,

now I'm getting the following error message:

<?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://geoserver.lbd.rlp:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
   <ServiceException>
      java.lang.RuntimeException: problem creating feature
  at
org.vfny.geoserver.wfs.requests.TransactionFeatureHandler.endElement(TransactionFeatureHandler.java:298)
  at org.geotools.gml.GMLFilterGeometry.endElement(GMLFilterGeometry.java:203)
  at org.geotools.gml.GMLFilterDocument.endElement(GMLFilterDocument.java:286)
  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:78)
  at
org.vfny.geoserver.servlets.AbstractService.doPost(AbstractService.java:435)
  at org.geoserver.request.Dispatcher.post(Dispatcher.java:301)
  at org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:181)
  at org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:52)
  at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
  at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
  at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
  at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
  at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
  at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:103)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544)
  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
  at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
  at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
  at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
  at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
  at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
  at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
  at java.lang.Thread.run(Thread.java:595)
Caused by: IllegalAttribute: com.vividsolutions.jts.geom.LineString , but got
com.vividsolutions.jts.geom.MultiLineString
  at org.geotools.feature.DefaultFeature.setAttribute(DefaultFeature.java:228)
  at org.geotools.feature.DefaultFeature.setAttributes(DefaultFeature.java:269)
  at org.geotools.feature.DefaultFeature.&lt;init&gt;(DefaultFeature.java:97)
  at
org.geotools.feature.DefaultFeatureType.create(DefaultFeatureType.java:171)
  at
org.geotools.feature.DefaultFeatureType.create(DefaultFeatureType.java:154)
  at
org.vfny.geoserver.wfs.requests.TransactionFeatureHandler.endElement(TransactionFeatureHandler.java:287)
  ... 44 more
Caused by: java.lang.IllegalArgumentException:
com.vividsolutions.jts.geom.MultiLineString is not an acceptable class for
the_geom as it is not assignable from class
com.vividsolutions.jts.geom.LineString
  at
org.geotools.feature.DefaultAttributeType.validate(DefaultAttributeType.java:375)
  at org.geotools.feature.DefaultFeature.setAttribute(DefaultFeature.java:225)
  ... 49 more
   </ServiceException>
</ServiceExceptionReport>

Regards,
Greq

Am Montag, 14. Januar 2008 14:53:19 schrieb Andrea Aime:

Gregor Fikoczek ha scritto:
> hi @ all,
> I am trying to insert geometries via "WFST-T - INSERT" in a PostGIS-DB.
> With the Point-geometry it works fine but with a Line/Polygon geometry I
> get an Error.
>
> (Using GeoServer 1.5.4)
>
> Request:
> -------------
> <wfs:Transaction version="1.0.0" service="WFS"
> xmlns:gml="http://www.opengis.net/gml&quot;
> xmlns:topp="http://www.openplans.org/topp&quot;
> xmlns:ogc="http://www.opengis.net/ogc&quot;
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
> xmlns:wfs="http://www.opengis.net/wfs&quot;
>
> xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.
>xsd http://www.openplans.org/topp
> http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:geo
>_line"> <wfs:Insert>
> <topp:geo_line>
> <bezeichnung>line digi</bezeichnung>
> <the_geom>
> <gml:MultiLineString srsName="EPSG:31467">
> <gml:lineStringMember>
> <gml:LineString>
> <gml:coordinates>3304000,5516000 3326000,5489000 3328000,5455000
> 3299000,5443000</gml:coordinates>
> </gml:LineString>
> </gml:lineStringMember>
> </gml:MultiLineString>
> </the_geom>
> </topp:geo_line>
> </wfs:Insert>
> </wfs:Transaction>
>
>
> Error:
> ---------
> <ServiceExceptionReport version="1.2.0"
> xsi:schemaLocation="http://www.opengis.net/ogc
> http://geoserver.lbd.rlp:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xs
>d"> <ServiceException>
> java.lang.RuntimeException: problem creating feature
> java.lang.RuntimeException: problem creating feature
> java.lang.RuntimeException: problem creating feature
> java.lang.RuntimeException: problem creating feature
> </ServiceException>
> </ServiceExceptionReport>
>
> Am I doing something wrong ?

Usually this happens when an attribute you've specified is incompatible
with the actual type declared in the feature type. Can you go to
config/server, enable verbose exceptions, and see if the error message
is any more illuminating? Alternatively, have a look in the geoserver
console (if you have one) or enable file logging and see what the full
stack trace is.

Cheers
Andrea

--
---------------------------------------
WhereGroup GmbH & Co. KG
Siemensstraße 8
53121 Bonn
Germany

Gregor Fikoczek
Email: gregor.fikoczek@anonymised.com
Fon: +49 (0)228 / 90 90 38 - 25
Fax: +49 (0)228 / 90 90 38 - 11

info@anonymised.com
www.wheregroup.com
Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Arnulf Christl, Olaf Knopp, Peter Stamm
---------------------------------------

Gregor Fikoczek ha scritto:

Hi Andrea,

now I'm getting the following error message:

...

Caused by: IllegalAttribute: com.vividsolutions.jts.geom.LineString , but got com.vividsolutions.jts.geom.MultiLineString

Here we go. You're trying to insert a multilinestring into a property
that's a linestring. They are not compatible.

Yet the original error message should have been more informative...
in fact there is a bug in the way we build the exception report:
http://jira.codehaus.org/browse/GEOS-1669

Cheers
Andrea

Hi Andrea,

thanks a lot for your hint,
i'm raeally trying to insert a MultiLine into a LineString... ,so I have to
change it

Best Regards,
Greq

Am Montag, 14. Januar 2008 16:55:31 schrieb Andrea Aime:

Gregor Fikoczek ha scritto:
> Hi Andrea,
>
>
> now I'm getting the following error message:

...

> Caused by: IllegalAttribute: com.vividsolutions.jts.geom.LineString , but
> got com.vividsolutions.jts.geom.MultiLineString

Here we go. You're trying to insert a multilinestring into a property
that's a linestring. They are not compatible.

Yet the original error message should have been more informative...
in fact there is a bug in the way we build the exception report:
http://jira.codehaus.org/browse/GEOS-1669

Cheers
Andrea

--
---------------------------------------
WhereGroup GmbH & Co. KG
Siemensstraße 8
53121 Bonn
Germany

Gregor Fikoczek
Email: gregor.fikoczek@anonymised.com
Fon: +49 (0)228 / 90 90 38 - 25
Fax: +49 (0)228 / 90 90 38 - 11

info@anonymised.com
www.wheregroup.com
Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Arnulf Christl, Olaf Knopp, Peter Stamm
---------------------------------------