Advanced search request fails with “Comparison method violates its general contract!”

book

Article ID: 207590

calendar_today

Updated On:

Products

CA Identity Suite CA Identity Portal

Issue/Introduction

When sorting results in the CA Identity Portal (IP) User Console Advanced search results screen with tasks archive, the request failed with the following message:

 

Comparison method violates its general contract!

Cause

The sorting algorithm used by java.util.Arrays.sort and (indirectly) by java.util.Collections.sort has been replaced to TimSort algorithm since Java 7. And the TimSort algorithm will throw the IllegalArgumentException if it happens to detect inconsistency in the comparison, but it is not guaranteed to do so. (It also depends on the order of the internal array, so the exception does not always happen.)

Environment

Release : 14.x

Component : CA IDENTITY SUITE (VIRTUAL APPLIANCE)

Resolution

If this is the cause of your case, you can work around this issue by adding the following to JAVA_OPTS in standalone.conf:

 

JAVA_OPTS="$JAVA_OPTS -Djava.util.Arrays.useLegacyMergeSort=true"

 

However we cannot allow to modify standalone.conf in the Virtual appliance.

Please add above argument under “#JAVA_OPTS=~” in the file below, then restart Identity Portal by restart_ip.

 

/opt/CA/VirtualAppliance/custom/IdentityPortal/jvm-args.conf

Additional Information

For more information on customizing the JVM Arguments, see the link below.

 

Customizing the JVM Startup Arguments

 

Attachments