Uploaded image for project: 'Jetspeed 2'
  1. Jetspeed 2
  2. JS2-1329

Number ClassCastException on Oracle

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0
    • Labels:
      None
    • Environment:
      Windows 7, Tomcat 7.0.56, Java 1.8.0_25, Oracle 10.2.0.1.0
    • Flags:
      Patch, Important

      Description

      In the JetspeedSecurityPersistenceManager there are casts to Integer (IDs from database) which won't work on Oracle. Oracle returns BigDecimal for NUMBER columns causing the attached ClassCastException.
      This takes place e.g. when RoleManagerImpl.isUserInRole is called.

      The problem is explained here:
      http://stackoverflow.com/questions/1419109/resultsetmetadata-returning-bigdecimal-insted-of-int
      http://docs.oracle.com/cd/B14117_01/java.101/b10979/datacc.htm

      I patched the JetspeedSecurityPersistenceManager see attachment which fulfills our needs. I don't know whether there are other wrong casts for Oracle.
      The problem occured with commit 1678139 from JS2-1324.

        Attachments

        1. ClassCastException.txt
          14 kB
          Martin Maidhof
        2. JetspeedSecurityPersistenceManager.java.patch
          4 kB
          Martin Maidhof

          Activity

            People

            • Assignee:
              rwatler W. Randall Watler
              Reporter:
              mmaid Martin Maidhof
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: