[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] (no subject)

Hello,

I?m porting an OC4J/TopLink project that uses Oracle Spatial to WebLogic 10/EclipseLink and am having some difficulty with a DirectToFieldMapping for JGeometry fields.

The JGeometryConverter is being defined through sessions.xml as:

         <struct-converters>
          <struct-converter>org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter</struct-converter>
         </struct-converters>

The direct to field mapping is setup using:

protected DirectToFieldMapping addJGeometryConversionMapping(String attributeName, String databaseFieldName) {
DirectToFieldMapping mapping = new DirectToFieldMapping();
mapping.setAttributeName(attributeName);
mapping.setFieldName(databaseFieldName);
mapping.setFieldType(java.sql.Types.STRUCT);
addMapping(mapping);
return mapping;
}


At runtime the following ClassCastException occurs:

[EL Warning]: ClientSession(6965749)--java.lang.ClassCastException: weblogic.jdbc.wrapper.Struct_oracle_sql_STRUCT
at org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter.convertToObject(JGeometryConverter.java:47)
at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getObjectFromResultSet(DatabasePlatform.java:1006)
at org.eclipse.persistence.platform.database.oracle.OraclePlatform.getObjectFromResultSet(OraclePlatform.java:386)
at org.eclipse.persistence.platform.database.oracle.Oracle9Platform.getObjectFromResultSet(Oracle9Platform.java:165)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.getObject(DatabaseAccessor.java:1085)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.fetchRow(DatabaseAccessor.java:882)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:621)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:500)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:522)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:204)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:190)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:261)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:594)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2505)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2463)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:478)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:883)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:666)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:844)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:456)
at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1178)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1162)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1108)


For non-JGeometry fields the EclipseLink setup by way of sessions.xml seems to be working fine. It appears that WebLogic dynamically slips in its own STRUCT type. Presumably I am missing a configuration step on the WebLogic side? I thought that I would ask before reverting to a custom converter.

Thank you in advance for any suggestions that this list might have.

-Alan Strait