[opencms-dev] Trouble with PostgreSQL 8
John Emmer
jemmer at avega.com
Fri May 6 20:51:28 CEST 2005
I'm running OpenCMS from the source. And I'm on SuSE 9.3. SuSE just
upgraded to PostgreSQL 8, and there seems to be an issue with that. If I
run with postgresql-8.0-311.jdbc3.jar in WEB-INF lib, I get thr following
error:
06 May 2005 11:24:16,338 ERROR [org.opencms.db.CmsSqlException: 64]
[org.opencms.db.postgresql.CmsVfsDriver] where:
org.opencms.db.generic.CmsVfsDriver.readResourcesWithProperty(CmsVfsDriver.java:1497),
why: org.postgresql.util.PSQLException: The column index is out of range:
2, number of columns: 1.query: SELECT DISTINCT
CMS_ONLINE_STRUCTURE.STRUCTURE_ID,CMS_ONLINE_STRUCTURE.RESOURCE_ID,CMS_ONLINE_STRUCTURE.RESOURCE_PATH,CMS_ONLINE_STRUCTURE.STRUCTURE_STATE,CMS_ONLINE_STRUCTURE.DATE_RELEASED,CMS_ONLINE_STRUCTURE.DATE_EXPIRED,CMS_ONLINE_RESOURCES.RESOURCE_ID,CMS_ONLINE_RESOURCES.RESOURCE_TYPE,CMS_ONLINE_RESOURCES.RESOURCE_FLAGS,CMS_ONLINE_RESOURCES.RESOURCE_STATE,CMS_ONLINE_RESOURCES.DATE_CREATED,CMS_ONLINE_RESOURCES.DATE_LASTMODIFIED,CMS_ONLINE_RESOURCES.USER_CREATED,CMS_ONLINE_RESOURCES.USER_LASTMODIFIED,CMS_ONLINE_RESOURCES.PROJECT_LASTMODIFIED
AS
LOCKED_IN_PROJECT,CMS_ONLINE_RESOURCES.RESOURCE_SIZE,CMS_ONLINE_RESOURCES.SIBLING_COUNT,CMS_ONLINE_RESOURCES.PROJECT_LASTMODIFIED
FROM ((CMS_ONLINE_STRUCTURE INNER JOIN CMS_ONLINE_RESOURCES ON
CMS_ONLINE_STRUCTURE.RESOURCE_ID=CMS_ONLINE_RESOURCES.RESOURCE_ID) INNER
JOIN CMS_ONLINE_PROPERTIES ON
(CMS_ONLINE_PROPERTIES.PROPERTY_MAPPING_ID=CMS_ONLINE_STRUCTURE.STRUCTURE_ID
OR
CMS_ONLINE_PROPERTIES.PROPERTY_MAPPING_ID=CMS_ONLINE_STRUCTURE.RESOURCE_ID
)) WHERE
CMS_ONLINE_PROPERTIES.PROPERTYDEF_ID=fa720216-be5a-11d9-8150-3b2a37a6203c
ORDER BY CMS_ONLINE_STRUCTURE.RESOURCE_PATH DESC SQL Exception
org.postgresql.util.PSQLException: The column index is out of range: 2,
number of columns: 1.
at
org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:38)
at
org.postgresql.core.v3.SimpleParameterList.setStringParameter(SimpleParameterList.java:72)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.bindString(AbstractJdbc2Statement.java:2025)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1155)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1145)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at
org.opencms.db.generic.CmsVfsDriver.readResourcesWithProperty(CmsVfsDriver.java:1497)
at
org.opencms.db.CmsDriverManager.readResourcesWithProperty(CmsDriverManager.java:5587)
at
org.opencms.db.CmsSecurityManager.readResourcesWithProperty(CmsSecurityManager.java:3566)
at
org.opencms.file.CmsObject.readResourcesWithProperty(CmsObject.java:2593)
at
org.opencms.staticexport.CmsStaticExportManager.setExportnames(CmsStaticExportManager.java:1974)
at
org.opencms.staticexport.CmsStaticExportManager.initialize(CmsStaticExportManager.java:1317)
at
org.opencms.main.OpenCmsCore.initConfiguration(OpenCmsCore.java:953)
at org.opencms.main.OpenCmsCore.initContext(OpenCmsCore.java:1059)
at
org.opencms.main.OpenCmsCore.upgradeRunlevel(OpenCmsCore.java:1462)
at org.opencms.main.OpenCmsServlet.init(OpenCmsServlet.java:197)
...
Note that there are no quotes around the POPERTYDEF_ID. If I add the
quotes and run the same query in psql, everything is fine. However, if I
run with pg74.215.jdbc3.jar in my WEB-INF/lib, I get:
06 May 2005 11:32:23,741 ERROR [org.opencms.db.CmsSqlException: 64]
[org.opencms.db.postgresql.CmsVfsDriver] where:
org.opencms.db.generic.CmsVfsDriver.readResourcesWithProperty(CmsVfsDriver.java:1497),
why: org.postgresql.util.PSQLException: Parameter index out of
range.query: SELECT DISTINCT
CMS_ONLINE_STRUCTURE.STRUCTURE_ID,CMS_ONLINE_STRUCTURE.RESOURCE_ID,CMS_ONLINE_STRUCTURE.RESOURCE_PATH,CMS_ONLINE_STRUCTURE.STRUCTURE_STATE,CMS_ONLINE_STRUCTURE.DATE_RELEASED,CMS_ONLINE_STRUCTURE.DATE_EXPIRED,CMS_ONLINE_RESOURCES.RESOURCE_ID,CMS_ONLINE_RESOURCES.RESOURCE_TYPE,CMS_ONLINE_RESOURCES.RESOURCE_FLAGS,CMS_ONLINE_RESOURCES.RESOURCE_STATE,CMS_ONLINE_RESOURCES.DATE_CREATED,CMS_ONLINE_RESOURCES.DATE_LASTMODIFIED,CMS_ONLINE_RESOURCES.USER_CREATED,CMS_ONLINE_RESOURCES.USER_LASTMODIFIED,CMS_ONLINE_RESOURCES.PROJECT_LASTMODIFIED
AS
LOCKED_IN_PROJECT,CMS_ONLINE_RESOURCES.RESOURCE_SIZE,CMS_ONLINE_RESOURCES.SIBLING_COUNT,CMS_ONLINE_RESOURCES.PROJECT_LASTMODIFIED
FROM ((CMS_ONLINE_STRUCTURE INNER JOIN CMS_ONLINE_RESOURCES ON
CMS_ONLINE_STRUCTURE.RESOURCE_ID=CMS_ONLINE_RESOURCES.RESOURCE_ID) INNER
JOIN CMS_ONLINE_PROPERTIES ON
(CMS_ONLINE_PROPERTIES.PROPERTY_MAPPING_ID=CMS_ONLINE_STRUCTURE.STRUCTURE_ID
OR
CMS_ONLINE_PROPERTIES.PROPERTY_MAPPING_ID=CMS_ONLINE_STRUCTURE.RESOURCE_ID
)) WHERE
CMS_ONLINE_PROPERTIES.PROPERTYDEF_ID='fa720216-be5a-11d9-8150-3b2a37a6203c'
ORDER BY CMS_ONLINE_STRUCTURE.RESOURCE_PATH DESC SQL Exception
org.postgresql.util.PSQLException: Parameter index out of range.
at
org.postgresql.jdbc1.AbstractJdbc1Statement.bind(AbstractJdbc1Statement.java:2090)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.setString(AbstractJdbc1Statement.java:1135)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.setString(AbstractJdbc1Statement.java:1116)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at
org.opencms.db.generic.CmsVfsDriver.readResourcesWithProperty(CmsVfsDriver.java:1497)
at
org.opencms.db.CmsDriverManager.readResourcesWithProperty(CmsDriverManager.java:5587)
at
org.opencms.db.CmsSecurityManager.readResourcesWithProperty(CmsSecurityManager.java:3566)
at
org.opencms.file.CmsObject.readResourcesWithProperty(CmsObject.java:2593)
at
org.opencms.staticexport.CmsStaticExportManager.setExportnames(CmsStaticExportManager.java:1974)
at
org.opencms.staticexport.CmsStaticExportManager.initialize(CmsStaticExportManager.java:1317)
at
org.opencms.main.OpenCmsCore.initConfiguration(OpenCmsCore.java:953)
at org.opencms.main.OpenCmsCore.initContext(OpenCmsCore.java:1059)
at
org.opencms.main.OpenCmsCore.upgradeRunlevel(OpenCmsCore.java:1462)
at
org.opencms.main.OpenCmsListener.contextInitialized(OpenCmsListener.java:86)
...
Note that the parameter is now quoted, and this query works as is in psql,
but we still get an error in OpenCMS.
I understand that PostgreSQL 8 may not be supported yet, but if someone
could even just provide me with a quick-fix hack to allow me to continue to
poke around in the code, that would be much appreciated.
Thanks!
-----------------------------------------------------------------------------
John Emmer
Senior Software Engineer
Avega
200 N. Sepulveda, Suite 600 El Segundo, CA 90245
310-563-3322 jemmer at avega.com
More information about the opencms-dev
mailing list