gvSIG bugs #4796

Falla la exportacion a PostgreSQL.

Added by Joaquín del Cerro Murciano over 6 years ago. Updated about 6 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:Joaquín del Cerro Murciano
Category:-
Target version:2.4.0-2847 (rev. org.gvsig.desktop-2.0.216)
Severity:Major Add-on version:
gvSIG version:2.4.0 Add-on build:
gvSIG build:2846 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch: Hito:
Add-on name:Unknown

Description

Al exportar una capa de puntos (un shape) a PostgreSQL falla con el error;

An error has been produced exporting a store
Can't INSERT feature in store 'puntos_logronos'.
Can't INSERT feature.
ERROR: function st_geomfromwkb(bytea, character varying) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 120

Parece que por alguna razon, al construir la sentencia SQL "insert", pasa el SRS a la funcion "ST_GeomFromWKB" como un string cuando deberia llegarle como un entero.

La traza del error completa que aparece en la consola es:

 INFO 62280 [Thread-8] (DefaultJExporttoServicePanel.java:291) - Exporting 'puntos_logrono' using 'org.gvsig.exportto.swing.prov.jdbc.ExporrtoJDBCService' (/home/jjdelcerro/datos/geodata/vector/shp2d/puntos_logrono/puntos_logrono.shp).
DEBUG 62285 [Thread-8] (AbstractConnectionOperation.java:58) - preparing execution of CreateTableOperation.
DEBUG 62285 [Thread-8] (PostgreSQLHelper.java:68) - getConnection:
BasicDataSource pool status:
  Connection URL: 'jdbc:postgresql://127.0.0.1:5432/gis'
  MaxActive: 8 (The maximum number of active connections that can be allocated from this pool at the same time)
  MaxIdle: 8 (The maximum number of connections that can remain idle in the pool)
  NumActive:0 (the current number of active connections)
  NumIdle:0 (the current number of idle connections)

DEBUG 62291 [Thread-8] (PostgreSQLHelper.java:78) - Created connection: 355485716
  NumActive: 1
  NumIdle: 0
DEBUG 62291 [Thread-8] (AbstractConnectionOperation.java:69) - Excuting operation CreateTableOperation.
DEBUG 62295 [Thread-8] (PostgreSQLHelper.java:68) - getConnection:
BasicDataSource pool status:
  Connection URL: 'jdbc:postgresql://127.0.0.1:5432/gis'
  MaxActive: 8 (The maximum number of active connections that can be allocated from this pool at the same time)
  MaxIdle: 8 (The maximum number of connections that can remain idle in the pool)
  NumActive:1 (the current number of active connections)
  NumIdle:0 (the current number of idle connections)

DEBUG 62297 [Thread-8] (PostgreSQLHelper.java:78) - Created connection: 2136767916
  NumActive: 2
  NumIdle: 0
DEBUG 62299 [Thread-8] (JDBCUtils.java:26) - execute query SQL: select srid, auth_name, auth_srid from spatial_ref_sys where upper(auth_name) = upper('EPSG') and auth_srid = 4326 
DEBUG 62418 [Thread-8] (JDBCUtils.java:32) - execute SQL: CREATE TABLE "gis"."public"."puntos_logrono" ("id" VARCHAR(20) DEFAULT '' NOT NULL, "x" DOUBLE PRECISION DEFAULT '0.0' NOT NULL, "campo3" DOUBLE PRECISION DEFAULT '0.0' NOT NULL, "hiperenlac" VARCHAR(254) DEFAULT '' NOT NULL, "pk"  SERIAL PRIMARY KEY )
DEBUG 62728 [Thread-8] (JDBCUtils.java:32) - execute SQL: SELECT AddGeometryColumn('public' , 'puntos_logrono' , 'geometry', 4326 , 'POINT' , 2, true)
DEBUG 62903 [Thread-8] (PostgreSQLHelper.java:104) - Closed connection: 355485716
  isClosed: true
  NumActive: 0
  NumIdle: 2
DEBUG 62908 [Thread-8] (AbstractConnectionOperation.java:58) - preparing execution of PostgreSQLFetchFeatureTypeOperation.
DEBUG 62914 [Thread-8] (PostgreSQLHelper.java:68) - getConnection:
BasicDataSource pool status:
  Connection URL: 'jdbc:postgresql://127.0.0.1:5432/gis'
  MaxActive: 8 (The maximum number of active connections that can be allocated from this pool at the same time)
  MaxIdle: 8 (The maximum number of connections that can remain idle in the pool)
  NumActive:0 (the current number of active connections)
  NumIdle:0 (the current number of idle connections)

DEBUG 62921 [Thread-8] (PostgreSQLHelper.java:78) - Created connection: 900682863
  NumActive: 1
  NumIdle: 0
DEBUG 62921 [Thread-8] (AbstractConnectionOperation.java:69) - Excuting operation PostgreSQLFetchFeatureTypeOperation.
DEBUG 62959 [Thread-8] (JDBCUtils.java:26) - execute query SQL: SELECT * FROM "gis"."public"."puntos_logrono" LIMIT 1
DEBUG 63060 [Thread-8] (JDBCUtils.java:26) - execute query SQL: SELECT "f_table_catalog", "f_table_schema", "f_table_name", "f_geometry_column", "coord_dimension", "srid", "type" FROM "geometry_columns" WHERE ( ("f_table_name") = ('puntos_logrono') ) AND ( ("f_geometry_column") = ('geometry') )
DEBUG 63080 [Thread-8] (JDBCUtils.java:26) - execute query SQL: select srid, auth_name, auth_srid from spatial_ref_sys where srid = 4326
DEBUG 63082 [Thread-8] (PostgreSQLHelper.java:104) - Closed connection: 900682863
  isClosed: true
  NumActive: 0
  NumIdle: 1
DEBUG 63084 [Thread-8] (PostgreSQLHelper.java:68) - getConnection:
BasicDataSource pool status:
  Connection URL: 'jdbc:postgresql://127.0.0.1:5432/gis'
  MaxActive: 8 (The maximum number of active connections that can be allocated from this pool at the same time)
  MaxIdle: 8 (The maximum number of connections that can remain idle in the pool)
  NumActive:0 (the current number of active connections)
  NumIdle:1 (the current number of idle connections)

DEBUG 63084 [Thread-8] (PostgreSQLHelper.java:78) - Created connection: 900682863
  NumActive: 1
  NumIdle: 0
DEBUG 63183 [Thread-8] (PostgreSQLHelper.java:68) - getConnection:
BasicDataSource pool status:
  Connection URL: 'jdbc:postgresql://127.0.0.1:5432/gis'
  MaxActive: 8 (The maximum number of active connections that can be allocated from this pool at the same time)
  MaxIdle: 8 (The maximum number of connections that can remain idle in the pool)
  NumActive:1 (the current number of active connections)
  NumIdle:0 (the current number of idle connections)

DEBUG 63186 [Thread-8] (PostgreSQLHelper.java:78) - Created connection: 1811581642
  NumActive: 2
  NumIdle: 0
DEBUG 63187 [Thread-8] (JDBCSQLBuilderBase.java:253) - st.set(/*1*/ '1', /*2*/ 542508.47853, /*3*/ 4704330.722153, /*4*/ '/home/jmarti/logrono.jpg', /*5*/ decode('000000000141208e58f501e6e24151f212ae37c09c','hex'), /*6*/ '4326', )
DEBUG 63188 [Thread-8] (JDBCUtils.java:54) - execute update SQL: INSERT INTO "gis"."public"."puntos_logrono" ( "id", "x", "campo3", "hiperenlac", "geometry" ) VALUES ( ?, ?, ?, ?, ST_GeomFromWKB((?), (?)) )
 WARN 63216 [Thread-8] (ExporrtoJDBCService.java:406) - Can't export data.
org.gvsig.fmap.dal.feature.exception.StoreInsertFeatureException: Can't insert feature in store 'puntos_logronos'.
        at org.gvsig.fmap.dal.feature.impl.DefaultFeatureStore.insert(DefaultFeatureStore.java:1260)
        at org.gvsig.exportto.swing.prov.jdbc.ExporrtoJDBCService.export(ExporrtoJDBCService.java:352)
        at org.gvsig.exportto.swing.impl.DefaultJExporttoServicePanel$Export.run(DefaultJExporttoServicePanel.java:293)
Caused by: java.lang.RuntimeException: Can't insert feature.
        at org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation.append(AppendOperation.java:125)
        at org.gvsig.fmap.dal.store.jdbc2.spi.JDBCStoreProviderBase.append(JDBCStoreProviderBase.java:583)
        at org.gvsig.fmap.dal.feature.impl.DefaultFeatureStore.insert(DefaultFeatureStore.java:1247)
        ... 2 more
Caused by: org.postgresql.util.PSQLException: ERROR: function st_geomfromwkb(bytea, character varying) does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
  Position: 120
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
        at org.gvsig.fmap.dal.store.jdbc2.JDBCUtils.executeUpdate(JDBCUtils.java:55)
        at org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation.append(AppendOperation.java:123)
        ... 4 more
DEBUG 63218 [Thread-8] (PostgreSQLHelper.java:104) - Closed connection: 900682863
  isClosed: true
  NumActive: 0
  NumIdle: 2
 WARN 63218 [Thread-8] (DefaultJExporttoServicePanel.java:295) - Problems exporting the data (layer=puntos_logrono).
org.gvsig.exportto.ExporttoServiceException: An error has been produced exporting a store
        at org.gvsig.exportto.swing.prov.jdbc.ExporrtoJDBCService.export(ExporrtoJDBCService.java:408)
        at org.gvsig.exportto.swing.impl.DefaultJExporttoServicePanel$Export.run(DefaultJExporttoServicePanel.java:293)
Caused by: org.gvsig.fmap.dal.feature.exception.StoreInsertFeatureException: Can't insert feature in store 'puntos_logronos'.
        at org.gvsig.fmap.dal.feature.impl.DefaultFeatureStore.insert(DefaultFeatureStore.java:1260)
        at org.gvsig.exportto.swing.prov.jdbc.ExporrtoJDBCService.export(ExporrtoJDBCService.java:352)
        ... 1 more
Caused by: java.lang.RuntimeException: Can't insert feature.
        at org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation.append(AppendOperation.java:125)
        at org.gvsig.fmap.dal.store.jdbc2.spi.JDBCStoreProviderBase.append(JDBCStoreProviderBase.java:583)
        at org.gvsig.fmap.dal.feature.impl.DefaultFeatureStore.insert(DefaultFeatureStore.java:1247)
        ... 2 more
Caused by: org.postgresql.util.PSQLException: ERROR: function st_geomfromwkb(bytea, character varying) does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
  Position: 120
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
        at org.gvsig.fmap.dal.store.jdbc2.JDBCUtils.executeUpdate(JDBCUtils.java:55)
        at org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation.append(AppendOperation.java:123)
        ... 4 more
 INFO 63218 [Thread-8] (Messages.java:753) - [org.gvsig.i18n.Messages] Cannot find translation for key '_Warning'.

Associated revisions

Revision 43738
Added by Joaquín del Cerro Murciano over 6 years ago

refs #4796, modificado el SRSSolverBase para que solo manaje SRS de tipo Integer. Si el gestor de BBDD lo requiere de otro tipo se debe aportar una implementacion a medida de SRSSolver (que es de tipo object)

Revision 452
Added by Joaquín del Cerro Murciano over 6 years ago

refs #4796, Corregido el tipo del SRS cuando se lee de la tabla geometry_columns. Se asumia String y es Integer.

History

#1 Updated by Joaquín del Cerro Murciano over 6 years ago

  • Target version changed from 2.4.0-2850-final (rev. org.gvsig.desktop-2.0.220) to 2.4.0-2847 (rev. org.gvsig.desktop-2.0.216)
  • Status changed from New to Fixed

#2 Updated by Álvaro Anguix about 6 years ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF