[Gvsig_desarrolladores] Error al tratar de salvar cambios en una capa

Francisco Puga fpuga en cartolab.es
Mar Feb 15 13:24:29 CET 2011


Creo que en esa consulta sql se está metiendo como último valor el gid
(2085). Lo mejor es que el gid esté en la base de datos como
autoincremental y no lo mandes en la consulta. Por otro lado puede que
tengas alguno de los campos como not null en la bd y ahora estes
insertando un null.

2011/2/14 raysel <rcastellanos en geosi.geocuba.cu>:
>
> Hola a todos
>
> Estoy teniendo problemas cuando voy a salvar los cambios efectuados en una
> capa.
> Yo trabajo con postgresql y la tabla que me esta dando problemas es de tipo
> poligono.
>
> Aqui pongo el error que me esta saliendo para ver si alguno de ustedes lo ha
> visto:
>
>
>
> Escribiendo la capa null con los campos FIELDS:, gid, id, nombre, codprov,
> codmun, desde, hasta, orilla, ancho, proyectada, cuenca, idrio
> Server encoding = UTF8
> sql = INSERT INTO public.f_fajas ( "id", "nombre", "codprov", "codmun",
> "desde", "hasta", "orilla", "ancho", "proyectada", "cuenca", "idrio",
> the_geom ) VALUES (null, null, null, null, null, null, null, null, null,
> null, null,  GeometryFromText( 'MULTIPOLYGON (((593493.717356745
> 238936.51088664937, 593857.5924492007 239286.90912382887, 593976.6380041398
> 239259.9554132766, 593601.5321989541 238857.89589753858, 593496.0050649182
> 238938.71386489022, 593482.486644015 238941.0031717414, 593491.5905072363
> 238939.46145791298, 593493.717356745 238936.51088664937, 593493.717356745
> 238936.51088664937)))', 2085) )
> DEBUG [AWT-EventQueue-1] (NotificationManager.java:104) -
> java.lang.IllegalStateException: Can't overwrite cause
> java.lang.IllegalStateException: Can't overwrite cause
>        at java.lang.Throwable.initCause(Throwable.java:320)
>        at
> com.iver.cit.gvsig.exceptions.visitors.ProcessWriterVisitorException.<init>(ProcessWriterVisitorException.java:11)
>        at
> com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGISWriter.process(PostGISWriter.java:184)
>        at
> com.iver.cit.gvsig.fmap.edition.EditableAdapter.saveEdits(EditableAdapter.java:365)
>        at
> com.iver.cit.gvsig.fmap.edition.EditableAdapter.stopEdition(EditableAdapter.java:272)
>        at
> com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter.stopEdition(VectorialEditableAdapter.java:939)
>        at
> com.iver.cit.gvsig.fmap.edition.VectorialEditableDBAdapter.stopEdition(VectorialEditableDBAdapter.java:455)
>        at com.iver.cit.gvsig.StopEditing.saveLayer(StopEditing.java:249)
>        at com.iver.cit.gvsig.StopEditing.stopEditing(StopEditing.java:170)
>        at com.iver.cit.gvsig.StopEditing.execute(StopEditing.java:120)
>        at
> com.iver.cit.gvsig.project.documents.view.toc.actions.StopEditingTocMenuEntry.execute(StopEditingTocMenuEntry.java:42)
>        at
> com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction.execute(AbstractTocContextMenuAction.java:39)
>        at
> com.iver.cit.gvsig.project.documents.view.toc.gui.FPopupMenu$MenuItem.actionPerformed(FPopupMenu.java:322)
>        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
>        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
>        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>        at javax.swing.AbstractButton.doClick(Unknown Source)
>        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
>        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
> Source)
>        at java.awt.Component.processMouseEvent(Unknown Source)
>        at javax.swing.JComponent.processMouseEvent(Unknown Source)
>        at java.awt.Component.processEvent(Unknown Source)
>        at java.awt.Container.processEvent(Unknown Source)
>        at java.awt.Component.dispatchEventImpl(Unknown Source)
>        at java.awt.Container.dispatchEventImpl(Unknown Source)
>        at java.awt.Component.dispatchEvent(Unknown Source)
>        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
>        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
>        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>        at java.awt.Container.dispatchEventImpl(Unknown Source)
>        at java.awt.Component.dispatchEvent(Unknown Source)
>        at java.awt.EventQueue.dispatchEvent(Unknown Source)
>        at
> com.iver.andami.ui.AndamiEventQueue.dispatchEvent(AndamiEventQueue.java:58)
>        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
>        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
>        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>        at java.awt.EventDispatchThread.run(Unknown Source)
>  WARN [AWT-EventQueue-1] (PluginServices.java:136) - Plugin com.iver.core --
> No se encontró la traducción para Consola de información
>  WARN [AWT-EventQueue-1] (PluginServices.java:136) - Plugin com.iver.core --
> No se encontró la traducción para Activa la ventana
> DEBUG [AWT-EventQueue-1] (NewSkin.java:411) - Activando Consola de
> información
> DEBUG [AWT-EventQueue-1] (MDIFrame.java:1057) - Memoria usada 99331 KB
> T cache snapping = 0 numGeoms=8
> Viewport despues: Datos del viewPort:
> Extent=java.awt.geom.Rectangle2D$Double[x=593159.0421173879,y=237919.00831330128,w=1664.3916266025044,h=1401.5929487179383]
> adjustedExtent=java.awt.geom.Rectangle2D$Double[x=592787.8609863108,y=237919.00831330128,w=2406.753888756769,h=1401.5929487179383]
> imageSize=java.awt.Dimension[width=1111,height=647]
> escale=0.46161761914671606
> trans=AffineTransform[[0.461617619146716, 0.0, -273641.3210475753], [0.0,
> -0.461617619146716, 110474.60616733388]]
> SqlAux getFeatureIterator = SELECT AsEWKB(the_geom, 'XDR'), gid FROM
> municipios WHERE the_geom && GeometryFromText('LINESTRING(592787.8609863108
> 237919.00831330128, 595194.6148750675 237919.00831330128, 595194.6148750675
> 239320.60126201922, 592787.8609863108 239320.60126201922)', 2085)
> Cambiando tamaño.
> Ancho del tree=234 1
> Ancho del TOC=150
> SqlAux getFeatureIterator = SELECT AsEWKB(the_geom, 'XDR'), gid FROM
> empresas WHERE the_geom && GeometryFromText('LINESTRING(592787.8609863108
> 237919.00831330128, 595194.6148750675 237919.00831330128, 595194.6148750675
> 239320.60126201922, 592787.8609863108 239320.60126201922)', 2085)
> SqlAux getFeatureIterator = SELECT AsEWKB(the_geom, 'XDR'), gid FROM
> unidadessilvicolas WHERE the_geom &&
> GeometryFromText('LINESTRING(592787.8609863108 237919.00831330128,
> 595194.6148750675 237919.00831330128, 595194.6148750675 239320.60126201922,
> 592787.8609863108 239320.60126201922)', 2085)
> SqlAux getFeatureIterator = SELECT AsEWKB(the_geom, 'XDR'), gid FROM lotes
> WHERE the_geom && GeometryFromText('LINESTRING(592787.8609863108
> 237919.00831330128, 595194.6148750675 237919.00831330128, 595194.6148750675
> 239320.60126201922, 592787.8609863108 239320.60126201922)', 2085)
> T cache snapping = 0 numGeoms=8
> SqlAux getFeatureIterator = SELECT AsEWKB(the_geom, 'XDR'), gid FROM rodales
> WHERE the_geom && GeometryFromText('LINESTRING(592787.8609863108
> 237919.00831330128, 595194.6148750675 237919.00831330128, 595194.6148750675
> 239320.60126201922, 592787.8609863108 239320.60126201922)', 2085)
> T cache snapping = 0 numGeoms=8
> SqlAux getFeatureIterator = SELECT AsEWKB(the_geom, 'XDR'), gid FROM
> public.f_cuencas WHERE the_geom &&
> GeometryFromText('LINESTRING(592787.8609863108 237919.00831330128,
> 595194.6148750675 237919.00831330128, 595194.6148750675 239320.60126201922,
> 592787.8609863108 239320.60126201922)', 2085)
> Can´t read the driver: PostGIS Driver
>        at
> com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGisDriver.getFeatureIterator(PostGisDriver.java:867)
>        at
> com.iver.cit.gvsig.fmap.layers.VectorialDBAdapter.getFeatureIterator(VectorialDBAdapter.java:126)
>        at
> com.iver.cit.gvsig.fmap.layers.VectorialDBAdapter.getFeatureIterator(VectorialDBAdapter.java:147)
>        at com.iver.cit.gvsig.fmap.layers.FLyrVect._draw(FLyrVect.java:395)
>        at com.iver.cit.gvsig.fmap.layers.FLyrVect.draw(FLyrVect.java:631)
>        at
> com.iver.cit.gvsig.fmap.DefaultMapContextDrawer.draw(DefaultMapContextDrawer.java:209)
>        at
> com.iver.cit.gvsig.fmap.DefaultMapContextDrawer.draw(DefaultMapContextDrawer.java:175)
>        at com.iver.cit.gvsig.fmap.MapContext.draw(MapContext.java:1092)
>        at
> com.iver.cit.gvsig.fmap.MapControl$PaintingRequest.paint(MapControl.java:1043)
>        at
> com.iver.cit.gvsig.fmap.MapControl$Drawer2$Worker.run(MapControl.java:1234)
>        at java.lang.Thread.run(Unknown Source)
> Caused by: Can´t read the driver: PostGIS Driver
>        at
> com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGisDriver.myGetFeatureIterator(PostGisDriver.java:364)
>        at
> com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGisDriver.getFeatureIterator(PostGisDriver.java:857)
>        ... 10 more
> Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block
>
>        at
> org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
>        at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
>        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
>        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)DEBUG
> [Thread-29] (NotificationManager.java:104) - Can´t read the driver: PostGIS
> Driver
>
> Gracias de antemano
>
>
> Saludos, Raisel
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Error-al-tratar-de-salvar-cambios-en-una-capa-tp6024832p6024832.html
> Sent from the gvSIG desarrolladores mailing list archive at Nabble.com.
> _______________________________________________
> gvSIG_desarrolladores mailing list
> gvSIG_desarrolladores en listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores
>



-- 
Francisco Puga
Grupo de Desarrollo
Cartolab - Laboratorio de Ingeniería Cartográfica.
http://www.cartolab.es

ETS Ingeniería de Caminos, Canales y Puertos
Universidade da Coruña
Campus de Elviña - 15071 A Coruña (España)
(34)981167000 ext. 5493


Más información sobre la lista de distribución gvSIG_desarrolladores