jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3521) IllegalArgumentException thrown on a box running java7 with a sorted query
Date Wed, 13 Feb 2013 12:08:12 GMT

    [ https://issues.apache.org/jira/browse/JCR-3521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13577511#comment-13577511
] 

Chetan Mehrotra commented on JCR-3521:
--------------------------------------

The issue happens on JDK 7 due to more stringent check for Comparable contract [1]. To workaround
this issue you can pass -Djava.util.Arrays.useLegacyMergeSort=true. The issue occurs org.apache.jackrabbit.core.query.lucene.Util#compare(Value[]
a, Value[] b) [2] method does not return 0 when both arguments are null.This breaks the transitive
nature of the comparable contract

[1] http://dertompson.com/2012/11/23/sort-algorithm-changes-in-java-7/ 
[2] https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java#L259
                
> IllegalArgumentException thrown on a box running java7 with a sorted query
> --------------------------------------------------------------------------
>
>                 Key: JCR-3521
>                 URL: https://issues.apache.org/jira/browse/JCR-3521
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: indexing
>    Affects Versions: 2.5.3
>         Environment: JDK 7
>            Reporter: Chetan Mehrotra
>
> Today we were running into this nice exception on a box running java7 with a sorted query
(by lastModified DESC):
> java.lang.IllegalArgumentException: Comparison method violates its general contract!
> 	at java.util.TimSort.mergeHi(TimSort.java:868)
> 	at java.util.TimSort.mergeAt(TimSort.java:485)
> 	at java.util.TimSort.mergeForceCollapse(TimSort.java:426)
> 	at java.util.TimSort.sort(TimSort.java:223)
> 	at java.util.TimSort.sort(TimSort.java:173)
> 	at java.util.Arrays.sort(Arrays.java:659)
> 	at java.util.Collections.sort(Collections.java:217)
> 	at
> org.apache.jackrabbit.core.query.lucene.join.QueryEngine.sort(QueryEngine.j
> ava:625)
> 	at
> org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngin
> e.java:484)
> 	at
> org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngin
> e.java:126)
> 	at
> org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngin
> e.java:115)
> 	at
> org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform(QueryObject
> ModelImpl.java:129)
> 	at
> org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform(QueryObject
> ModelImpl.java:124)
> 	at
> org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:2
> 16)
> 	at
> org.apache.jackrabbit.core.query.QueryObjectModelImpl.execute(QueryObjectMo
> delImpl.java:123)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message