Re: [Geoserver-users] Exception when inserting a new feature in PostGIS through GeoServer/WFS-T: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
Dear Chris, dear list, The following XML Schema describes my WFS layer (DescribeFeatureType): xsd:complexType name=zonesType xsd:complexContent xsd:extension base=gml:AbstractFeatureType xsd:sequence xsd:element maxOccurs=1 minOccurs=0 name=geom nillable=true type=gml:SurfacePropertyType/ xsd:element maxOccurs=1 minOccurs=0 name=sitename nillable=true type=xsd:string/ /xsd:sequence /xsd:extension /xsd:complexContent /xsd:complexType xsd:element name=zones substitutionGroup=gml:_Feature type=MNS:zonesType/ A GetFeature-request (limiting to 1 feature) results in the following instance: ?xml version=1.0 encoding=utf-8? wfs:FeatureCollection numberOfFeatures=1 timeStamp=2011-01-24T11:03:05.665+01:00 xsi:schemaLocation= http://10.38.11.2:8080/geoserver/wfs?service=WFSamp;version=1.1.0amp;request=DescribeFeatureTypeamp;typeName=MNS%3Azones http://www.opengis.net/wfs http://10.38.11.2:8080/geoserver/schemas/wfs/1.1.0/wfs.xsd; xmlns:ogc=http://www.opengis.net/ogc; xmlns:gml=http://www.opengis.net/gml; xmlns:MNS=http://dummy.mns.ns.glob; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xlink=http://www.w3.org/1999/xlink; xmlns:ows=http://www.opengis.net/ows; xmlns:wfs=http://www.opengis.net/wfs; gml:featureMembers MNS:zones gml:id=zones.1 MNS:geom gml:Polygon srsName=urn:x-ogc:def:crs:EPSG:28992 gml:exterior gml:LinearRing gml:posList153864.27125 387699.24825 153864.27125 417699.24825 173864.27125 417699.24825 173864.27125 387699.24825 153864.27125 387699.24825/gml:posList /gml:LinearRing /gml:exterior /gml:Polygon /MNS:geom MNS:sitenameBRAB/MNS:sitename /MNS:zones /gml:featureMembers /wfs:FeatureCollection Editing a feature in MapInfo produces the following Update-transaction which is successfully handled by GeoServer: ?xml version=1.0? wfs:Transaction version=1.0.0 service=WFS xmlns:wfs=http://www.opengis.net/wfs; xmlns:MNS=http://dummy.mns.ns.glob; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns=http://www.opengis.net/wfs; xsi:schemaLocation=http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; wfs:Update xmlns:wfs=http://www.opengis.net/wfs; typeName=MNS:zones wfs:Property wfs:NameMNS:geom/wfs:Name wfs:Value gml:MultiPolygon xmlns:gml=http://www.opengis.net/gml; srsName=EPSG:28992 gml:polygonMember gml:Polygon gml:outerBoundaryIs gml:LinearRing gml:coordinates289600,474884 257788,467100 258803,442395 301783,437657 305738.201,451427.5 297722,464054 289600,474884/gml:coordinates /gml:LinearRing /gml:outerBoundaryIs /gml:Polygon /gml:polygonMember /gml:MultiPolygon /wfs:Value /wfs:Property ogc:Filter xmlns:ogc=http://www.opengis.net/ogc; ogc:FeatureId fid=zones.9 / /ogc:Filter /wfs:Update /wfs:Transaction Creating a new feature using a MapInfo produces the following transaction, which raises an exception as described in my previous message: ?xml version=1.0? wfs:Transaction version=1.0.0 service=WFS xmlns:wfs=http://www.opengis.net/wfs; xmlns:MNS=http://dummy.mns.ns.glob; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns=http://www.opengis.net/wfs; xsi:schemaLocation=http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; wfs:Insert xmlns:wfs=http://www.opengis.net/wfs; MNS:zones xmlns:MNS=http://dummy.mns.ns.glob; MNS:geom gml:MultiPolygon xmlns:gml=http://www.opengis.net/gml; srsName=EPSG:28992 gml:polygonMember gml:Polygon gml:outerBoundaryIs gml:LinearRing gml:coordinates181961.101,438326.5 181961.101,468326.5 201961.101,468326.5 200761.299,454355.098 201961.101,438326.5 181961.101,438326.5/gml:coordinates /gml:LinearRing /gml:outerBoundaryIs /gml:Polygon /gml:polygonMember /gml:MultiPolygon /MNS:geom sitenameHA2/sitename /MNS:zones /wfs:Insert /wfs:Transaction Yet, using QGIS, I can indeed Insert a new feature; all is handled nicely by GeoServer: Transaction xmlns=http://www.opengis.net/wfs; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=1.0.0 service=WFS xsi:schemaLocation=http://dummy.mns.ns.glob http://mnsgeo:8080/geoserver/wfs?getcapabilitiesamp;SERVICE=WFSamp;VERSION=1.0.0amp;REQUEST=DescribeFeatureTypeamp;TYPENAME=MNS:zones
Re: [Geoserver-users] Exception when inserting a new feature in PostGIS through GeoServer/WFS-T: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
Dear list, dear Chris, Sorry for posting so limited information, as I merely described the usage scenario... Below I pasted the verbose log, starting off with the actual WFS-T-request posted by MapInfo (inserting a single feature; column names: geom, sitename). Just before the massive stack trace a SELECT-query is posted: SELECT idx,encode(asBinary(force_ 2d(geom),'XDR'),'base64') as geom,sitename FROM public.zones WHERE 0 = 1 Something wrong there? Full log: 20 Jan 11:08:30 DEBUG [geoserver.ows] - Raw XML request starts with: ?xml version=1.0 ? wfs:Transaction version=1.0.0 service=WFS xmlns:wfs=http://www.opengis.net/wfs; xmlns:MNS=http://dummy.mns.ns.glob; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns=http://www.opengis.net/wfs; xsi:schemaLocation=http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; wfs:Insert xmlns:wfs=http://www.opengis.net/wfs;MNS:zones xmlns:MNS= http://dummy.mns.ns.glob;MNS:geomgml:MultiPolygon xmlns:gml= http://www.opengis.net/gml; srsName=EPSG:28992gml:polygonMembergml:Polygongml:outerBoundaryIsgml:LinearRinggml:coordinates290198.402,434467.902 251016,417508.402 279087,382419.799 312421.299,405227.402 290198.402,434467.902/gml:coordinates/gml:LinearRing/gml:outerBoundaryIs/gml:Polygon/gml:polygonMember/gml:MultiPolygon/MNS:geomsitenameHAA/sitename/MNS:zones/wfs:Insert/wfs:Transaction 20 Jan 11:08:30 INFO [geoserver.wfs] - Request: getServiceInfo 20 Jan 11:08:30 DEBUG [geotools.xml] - schemaLocation found: http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd 20 Jan 11:08:30 DEBUG [geotools.xml] - Found override for http://www.opengis.net/wfs: ../wfs/1.0.0/WFS-basic.xsd == jar:file:/usr/local/geoserver-2.0.2/webapps/geoserver/WEB-INF/lib/wfs-2.0.2.jar!/org/geoserver/wfs/xml/v1_0_0/WFS-basic.xsd 20 Jan 11:08:30 DEBUG [geotools.xml] - Could not find declaration for: { http://www.opengis.net/wfs}sitename http://www.opengis.net/wfs%7Dsitename. Checking if containing type declares a single particle. 20 Jan 11:08:30 DEBUG [geotools.xml] - Could not find declaration for: { http://www.opengis.net/wfs}sitename http://www.opengis.net/wfs%7Dsitename. Performing lookup by ignoring namespace 20 Jan 11:08:30 DEBUG [geoserver.wfs] - Locating FeatureSource uri:' http://dummy.mns.ns.glob' name:'zones' 20 Jan 11:08:30 DEBUG [geoserver.wfs] - located FeatureType w/ typeRef 'APPEL:zones' and elementName '{http://dummy.mns.ns.glob}zones' 20 Jan 11:08:30 DEBUG [geoserver.wfs] - Transasction Insert:net.opengis.wfs.impl.InsertElementTypeImpl@174f6ce (feature: [SimpleFeatureImpl:zones=[SimpleFeatureImpl.Attribute: geomgeom id=fid--38cac012_12da2e59234_-8000=, SimpleFeatureImpl.Attribute: sitenamesitename id=fid--38cac012_12da2e59234_-8000=HAA]], handle: null, idgen: unset, inputFormat: unset, srsName: null) 20 Jan 11:08:30 DEBUG [geoserver.wfs] - Use featureValidation to check contents of insert 20 Jan 11:08:30 DEBUG [geotools.jdbc] - CREATE CONNECTION 20 Jan 11:08:30 TRACE [geotools.core] - ENTRY -12,345 20 Jan 11:08:30 DEBUG [geotools.jdbc] - SELECT idx,encode(asBinary(force_2d(geom),'XDR'),'base64') as geom,sitename FROM public.zones WHERE 0 = 1 20 Jan 11:08:30 INFO [gwc.GWCCleanser] - Deleting GWC cache for MNS:zones 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting geom to 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting 0 to 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting sitename to HAA 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting 1 to HAA 20 Jan 11:08:30 ERROR [geoserver.wfs] - Transaction failed org.geoserver.wfs.WFSTransactionException: Error performing insert at org.geoserver.wfs.InsertElementHandler.execute(InsertElementHandler.java:204) at org.geoserver.wfs.Transaction.execute(Transaction.java:334) at org.geoserver.wfs.Transaction.transaction(Transaction.java:109) at org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureService.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.geoserver.ows.util.EMFLogger.invoke(EMFLogger.java:51) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at
Re: [Geoserver-users] Exception when inserting a new feature in PostGIS through GeoServer/WFS-T: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
Can you post in the results of a describe feature type? And of a wfs get feature from that table? Could you try to re-insert one of the results you get from a get feature request back in? To see if it's a mapinfo problem or a problem with all transactions. On Thu, Jan 20, 2011 at 4:15 AM, InterRob rob.mar...@gmail.com wrote: Dear list, dear Chris, Sorry for posting so limited information, as I merely described the usage scenario... Below I pasted the verbose log, starting off with the actual WFS-T-request posted by MapInfo (inserting a single feature; column names: geom, sitename). Just before the massive stack trace a SELECT-query is posted: SELECT idx,encode(asBinary(force_ 2d(geom),'XDR'),'base64') as geom,sitename FROM public.zones WHERE 0 = 1 Something wrong there? Full log: 20 Jan 11:08:30 DEBUG [geoserver.ows] - Raw XML request starts with: ?xml version=1.0 ? wfs:Transaction version=1.0.0 service=WFS xmlns:wfs=http://www.opengis.net/wfs; xmlns:MNS=http://dummy.mns.ns.glob; xmlns:gml=http://www.opengis.net/gml; xmlns:ogc=http://www.opengis.net/ogc; xmlns=http://www.opengis.net/wfs; xsi:schemaLocation=http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; wfs:Insert xmlns:wfs=http://www.opengis.net/wfs;MNS:zones xmlns:MNS= http://dummy.mns.ns.glob;MNS:geomgml:MultiPolygon xmlns:gml= http://www.opengis.net/gml; srsName=EPSG:28992gml:polygonMembergml:Polygongml:outerBoundaryIsgml:LinearRinggml:coordinates290198.402,434467.902 251016,417508.402 279087,382419.799 312421.299,405227.402 290198.402,434467.902/gml:coordinates/gml:LinearRing/gml:outerBoundaryIs/gml:Polygon/gml:polygonMember/gml:MultiPolygon/MNS:geomsitenameHAA/sitename/MNS:zones/wfs:Insert/wfs:Transaction 20 Jan 11:08:30 INFO [geoserver.wfs] - Request: getServiceInfo 20 Jan 11:08:30 DEBUG [geotools.xml] - schemaLocation found: http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd 20 Jan 11:08:30 DEBUG [geotools.xml] - Found override for http://www.opengis.net/wfs: ../wfs/1.0.0/WFS-basic.xsd == jar:file:/usr/local/geoserver-2.0.2/webapps/geoserver/WEB-INF/lib/wfs-2.0.2.jar!/org/geoserver/wfs/xml/v1_0_0/WFS-basic.xsd 20 Jan 11:08:30 DEBUG [geotools.xml] - Could not find declaration for: { http://www.opengis.net/wfs}sitenamehttp://www.opengis.net/wfs%7Dsitename. Checking if containing type declares a single particle. 20 Jan 11:08:30 DEBUG [geotools.xml] - Could not find declaration for: { http://www.opengis.net/wfs}sitenamehttp://www.opengis.net/wfs%7Dsitename. Performing lookup by ignoring namespace 20 Jan 11:08:30 DEBUG [geoserver.wfs] - Locating FeatureSource uri:' http://dummy.mns.ns.glob' name:'zones' 20 Jan 11:08:30 DEBUG [geoserver.wfs] - located FeatureType w/ typeRef 'APPEL:zones' and elementName '{http://dummy.mns.ns.glob}zones' 20 Jan 11:08:30 DEBUG [geoserver.wfs] - Transasction Insert:net.opengis.wfs.impl.InsertElementTypeImpl@174f6ce (feature: [SimpleFeatureImpl:zones=[SimpleFeatureImpl.Attribute: geomgeom id=fid--38cac012_12da2e59234_-8000=, SimpleFeatureImpl.Attribute: sitenamesitename id=fid--38cac012_12da2e59234_-8000=HAA]], handle: null, idgen: unset, inputFormat: unset, srsName: null) 20 Jan 11:08:30 DEBUG [geoserver.wfs] - Use featureValidation to check contents of insert 20 Jan 11:08:30 DEBUG [geotools.jdbc] - CREATE CONNECTION 20 Jan 11:08:30 TRACE [geotools.core] - ENTRY -12,345 20 Jan 11:08:30 DEBUG [geotools.jdbc] - SELECT idx,encode(asBinary(force_2d(geom),'XDR'),'base64') as geom,sitename FROM public.zones WHERE 0 = 1 20 Jan 11:08:30 INFO [gwc.GWCCleanser] - Deleting GWC cache for MNS:zones 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting geom to 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting 0 to 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting sitename to HAA 20 Jan 11:08:30 DEBUG [geotools.jdbc] - Setting 1 to HAA 20 Jan 11:08:30 ERROR [geoserver.wfs] - Transaction failed org.geoserver.wfs.WFSTransactionException: Error performing insert at org.geoserver.wfs.InsertElementHandler.execute(InsertElementHandler.java:204) at org.geoserver.wfs.Transaction.execute(Transaction.java:334) at org.geoserver.wfs.Transaction.transaction(Transaction.java:109) at org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureService.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
[Geoserver-users] Exception when inserting a new feature in PostGIS through GeoServer/WFS-T: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
Dear list, I have a PostGIS table with just 8 geometries (polygons), each row having only one data attribute (character(8) ). Using MapInfo 10.5 as a client, I downloaded these through WFS. Then, I added one feature by drawing a polygon and assigning some text to the new records' single attribute. To commit the editing to DBMS, I instructed MapInfo to save the table: MapInfo then generates a transaction request. However, GeoServer fails to process the transaction, logging a org.geoserver.wfs.WFSTransactionException (Error performing insert). It is stated that the exception was caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry I'm running GeoServer 2.0.2. What is possibly causing this? Any help or hints are very much appreciated! Regards, Rob. -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl___ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users
Re: [Geoserver-users] Exception when inserting a new feature in PostGIS through GeoServer/WFS-T: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
You're going to need to provide some more info to give anyone the chance to help solve the problem. Can you get what the actual transaction request that MapInfo is sending? Posting the logs with the logging level turned up also may help. Chris On Wed, Jan 19, 2011 at 11:20 AM, InterRob rob.mar...@gmail.com wrote: Dear list, I have a PostGIS table with just 8 geometries (polygons), each row having only one data attribute (character(8) ). Using MapInfo 10.5 as a client, I downloaded these through WFS. Then, I added one feature by drawing a polygon and assigning some text to the new records' single attribute. To commit the editing to DBMS, I instructed MapInfo to save the table: MapInfo then generates a transaction request. However, GeoServer fails to process the transaction, logging a org.geoserver.wfs.WFSTransactionException (Error performing insert). It is stated that the exception was caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry I'm running GeoServer 2.0.2. What is possibly causing this? Any help or hints are very much appreciated! Regards, Rob. -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl___ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users