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

Number ClassCastException on Oracle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.3.0
    • None
    • Windows 7, Tomcat 7.0.56, Java 1.8.0_25, Oracle 10.2.0.1.0
    • 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. JetspeedSecurityPersistenceManager.java.patch
          4 kB
          Martin Maidhof
        2. ClassCastException.txt
          14 kB
          Martin Maidhof

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: