Shiro
  1. Shiro
  2. SHIRO-234

ClassCastException in checkRoles

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.0
    • Component/s: None
    • Labels:
      None

      Description

      I get the following:

      java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
      at org.apache.shiro.authz.ModularRealmAuthorizer.checkRoles(ModularRealmAuthorizer.java:426)

      In checkRoles, the collection is incorrectly cast to a String[]. The line needs to do toArray(new String[roles.size]) and not toArray().

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        51d 21h 31m 1 Les Hazlewood 05/Mar/11 22:18
        Resolved Resolved Closed Closed
        324d 2h 53m 1 Les Hazlewood 24/Jan/12 01:11
        Les Hazlewood made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Les Hazlewood added a comment -

        Closing with the 1.2.0 release.

        Show
        Les Hazlewood added a comment - Closing with the 1.2.0 release.
        Les Hazlewood made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.2.0 [ 12315478 ]
        Resolution Fixed [ 1 ]
        Hide
        Les Hazlewood added a comment -

        Thanks for the issue!

        Show
        Les Hazlewood added a comment - Thanks for the issue!
        Dan Diephouse created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Dan Diephouse
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development