Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-38978

Content Hosting comparators are incompatible with java 7



    • Type: Bug
    • Status: CLOSED
    • Priority: Blocker
    • Resolution: Won't Fix
    • Affects Version/s: 2.9.x
    • Fix Version/s: None
    • Component/s: Kernel
    • Labels:
    • CLE Team Issue:
    • Previous Issue Keys:


      Reported by Kevin @ University of Virginia

      Some of our users have encountered an error (attached) when trying to access resources in certain worksites.

      https://jira.sakaiproject.org/browse/MSGCNTR-810 describes the same error, but the fix within is for the msgcntr tool, not content. It would seem it's an issue with array/collection comparators in Java 7; whereas older Java would just ignore this situation, Java 7 throws an exception.

      I've looked at both ResourcesAction.java and ListItem.java within the content tool but I don't see how I would apply a similar fix in either location. I'm getting a sense that this may require a kernel change and affect more than just the content tool.

      It appears this error is caused by a nested exception java.lang.IllegalArgumentException: Comparison method violates its general contract!

      Some research revealed that Java 7 implemented a new sort routine that strictly validates comparators, while Java 6 silently ignored issues with comparators not honoring transitivity etc.

      There is a system property that can be set to force Java 7 to use the legacy sort routine. As a workaround for this issue, we've set the JVM property -Djava.util.Arrays.useLegacyMergeSort=true

      This restored Resources functionality. Obviously, the long-term solution should be to tighten up the comparators in Sakai to strictly adhere to spec

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  k1team KERNEL TEAM (Inactive)
                  aaronz Aaron Zeckoski (Inactive)
                • Votes:
                  0 Vote for this issue
                  9 Start watching this issue


                  • Created:

                    Git Source Code