Hibernate Spatial

ClassCastException when saving geometries

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1.1
  • Component/s: Oracle10g
  • Description:
    Hide
    See report by Sarah Haskins:


    "ClassCastException on line 51 of OracleJDBCTypeFactory.

    java.lang.ClassCastException: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection
    at oracle.sql.STRUCT.<init>(STRUCT.java:138)
    at org.hibernatespatial.oracle.OracleJDBCTypeFactory.createStruct(OracleJDBCTypeFactory.java:51)
    at org.hibernatespatial.oracle.SDOGeometry.store(SDOGeometry.java:154)
    at org.hibernatespatial.oracle.SDOGeometryType.conv2DBGeometry(SDOGeometryType.java:82)
    ...

    I have a custom ConnectionFinder which is being called to return the "oracleConnection" in OracleJDBCTypeFactory.createStruct, but since the oracleConnection is not used to create the STRUCT (the initial method argument conn is used instead), I am getting this ClassCastException."
    Show
    See report by Sarah Haskins: "ClassCastException on line 51 of OracleJDBCTypeFactory. java.lang.ClassCastException: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection at oracle.sql.STRUCT.<init>(STRUCT.java:138) at org.hibernatespatial.oracle.OracleJDBCTypeFactory.createStruct(OracleJDBCTypeFactory.java:51) at org.hibernatespatial.oracle.SDOGeometry.store(SDOGeometry.java:154) at org.hibernatespatial.oracle.SDOGeometryType.conv2DBGeometry(SDOGeometryType.java:82) ... I have a custom ConnectionFinder which is being called to return the "oracleConnection" in OracleJDBCTypeFactory.createStruct, but since the oracleConnection is not used to create the STRUCT (the initial method argument conn is used instead), I am getting this ClassCastException."

Issue Links

Activity

Karel Maesen made changes - 21/Jun/11 10:01 PM
Field Original Value New Value
Link This issue duplicates HIBSPA-87 [ HIBSPA-87 ]
Karel Maesen made changes - 22/Jun/11 11:09 AM
Status Open [ 1 ] In Progress [ 3 ]
Karel Maesen made changes - 22/Jun/11 11:13 AM
Resolution Fixed [ 1 ]
Fix Version/s 1.1.1 [ 10020 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Karel Maesen made changes - 01/Nov/11 12:16 PM
Status Resolved [ 5 ] Closed [ 6 ]

People

Dates

  • Created:
    10/Jun/11 11:33 AM
    Updated:
    01/Nov/11 12:16 PM
    Resolved:
    22/Jun/11 11:13 AM