[opencms-dev] Strange behaviour importing contents
Ramos Sañudo, Fidel
FRAMOS at sadiel.es
Fri Jul 29 13:35:08 CEST 2005
Hi,
I'm experiencing an unexpected error when I try to import some contents in OpenCMS over Oracle 8.1. I found a solution, but still don't know why it happens.
The background: I exported data from an Oracle DB to XML using BIE. Then imported the XML to OpenCMS using the XMLdb module. After that I manipulate the contents a bit, changing groups and some other things. Then I export several folders to ZIP. Everything goes fine.
But, importing some ZIPs produce errors (I'm putting one at the end of the mail). After some research I discover that the troublesome contents are those with more than 450 characters in one of the fields of the original Oracle DB. This field is VARCHAR2(500), but the crazy thing is that the PROPERTY_VALUE field of CMS_PROPERTIES is also VARCHAR2(500), so why doesn't it fit? Why does a content with say 420 characters fit OK and with 450 or more doesn't?
The solution (read hack) given is increasing the PROPERTY_VALUE field to 600 (to have a margin). After this every ZIP imports fine. Data is text, with Spanish accentuated letters and "ñ", but the content is declared as ISO-8859-1 and should be 1-char/1-byte, shouldn't it?
Does someone have any idea about this? I've looked at the OpenCMS classes showed in the Exception trace, thinking that maybe OpenCMS added something to the data prior to importing or inserting at the DB, but I found nothing.
Thanks to anyone who can shed some light on this mistery.
The error is:
Importando
/Contenidos_Empleado/Contenido_General/Legislacion/2005/Abril/ContenidoGeneral_3427
Excepcióncom.opencms.core.CmsException: 4 Sql exception. Detailed error:
[com.opencms.file.oraclesql.CmsDbAccess] ORA-01401: inserted value too large
for column
.
root cause was java.sql.SQLException: ORA-01401: inserted value too large for
column
at com.opencms.file.genericSql.CmsDbAccess.writeProperty(CmsDbAccess.java:12005)
at
com.opencms.file.genericSql.CmsDbAccess.writeProperties(CmsDbAccess.java:11937)
at
com.opencms.file.genericSql.CmsResourceBroker.writeResource(CmsResourceBroker.java:7641)
at com.opencms.file.CmsObject.doWriteResource(CmsObject.java:1074)
at com.opencms.file.A_CmsResourceType.importResource(A_CmsResourceType.java:616)
at com.opencms.file.CmsObject.importResource(CmsObject.java:2142)
at com.opencms.file.CmsImport.importResource(CmsImport.java:601)
at com.opencms.file.CmsImport.importAllResources(CmsImport.java:786)
at com.opencms.file.CmsImport.importResources(CmsImport.java:188)
at
com.opencms.file.genericSql.CmsResourceBroker.importResources(CmsResourceBroker.java:4162)
at com.opencms.file.CmsObject.importResources(CmsObject.java:2169)
at
com.opencms.workplace.CmsAdminDatabaseImportThread.run(CmsAdminDatabaseImportThread.java:74)
>-----------
>Root cause:
>java.sql.SQLException: ORA-01401: inserted value too large for column
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
> at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
> at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
> at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
> at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
> at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
> at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
> at
com.opencms.file.genericSql.CmsDbAccess.writeProperty(CmsDbAccess.java:12002)
> at
com.opencms.file.genericSql.CmsDbAccess.writeProperties(CmsDbAccess.java:11937)
> at
com.opencms.file.genericSql.CmsResourceBroker.writeResource(CmsResourceBroker.java:7641)
> at com.opencms.file.CmsObject.doWriteResource(CmsObject.java:1074)
> at
com.opencms.file.A_CmsResourceType.importResource(A_CmsResourceType.java:616)
> at com.opencms.file.CmsObject.importResource(CmsObject.java:2142)
> at com.opencms.file.CmsImport.importResource(CmsImport.java:601)
> at com.opencms.file.CmsImport.importAllResources(CmsImport.java:786)
> at com.opencms.file.CmsImport.importResources(CmsImport.java:188)
> at
com.opencms.file.genericSql.CmsResourceBroker.importResources(CmsResourceBroker.java:4162)
> at com.opencms.file.CmsObject.importResources(CmsObject.java:2169)
> at
com.opencms.workplace.CmsAdminDatabaseImportThread.run(CmsAdminDatabaseImportThread.java:74)
java.sql.SQLException: ORA-01401: inserted value too large for column
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at com.opencms.file.genericSql.CmsDbAccess.writeProperty(CmsDbAccess.java:12002)
at
com.opencms.file.genericSql.CmsDbAccess.writeProperties(CmsDbAccess.java:11937)
at
com.opencms.file.genericSql.CmsResourceBroker.writeResource(CmsResourceBroker.java:7641)
at com.opencms.file.CmsObject.doWriteResource(CmsObject.java:1074)
at com.opencms.file.A_CmsResourceType.importResource(A_CmsResourceType.java:616)
at com.opencms.file.CmsObject.importResource(CmsObject.java:2142)
at com.opencms.file.CmsImport.importResource(CmsImport.java:601)
at com.opencms.file.CmsImport.importAllResources(CmsImport.java:786)
at com.opencms.file.CmsImport.importResources(CmsImport.java:188)
at
com.opencms.file.genericSql.CmsResourceBroker.importResources(CmsResourceBroker.java:4162)
at com.opencms.file.CmsObject.importResources(CmsObject.java:2169)
at
com.opencms.workplace.CmsAdminDatabaseImportThread.run(CmsAdminDatabaseImportThread.java:74)
Fidel Ramos
More information about the opencms-dev
mailing list