MinimServer Forum
Comparison method violates its general contract! - Printable Version

+- MinimServer Forum (https://forum.minimserver.com)
+-- Forum: MinimServer (/forumdisplay.php?fid=1)
+--- Forum: Support (/forumdisplay.php?fid=4)
+--- Thread: Comparison method violates its general contract! (/showthread.php?tid=495)



Comparison method violates its general contract! - Mike48 - 10-03-2013 02:26

I don't know what to make of this:

Sat Mar 09 17:20:09 MinimServer: exception while processing action request: java.lang.IllegalArgumentException: Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeHi(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeForceCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.minimserver.Server.sortAlbumList(Server.java:3461)
at com.minimserver.Server.access$10700(Server.java:84)
at com.minimserver.Server$AlbumListView.init(Server.java:9059)
at com.minimserver.Server$AlbumListView.<init>(Server.java:8995)
at com.minimserver.Server$AlbumListContainer.populate(Server.java:9150)
at com.minimserver.Server.populateContainer(Server.java:3440)
at com.minimserver.Server.access$12600(Server.java:84)
at com.minimserver.Server$ContentDirectoryProvider.doBrowse(Server.java:9906)
at com.minimserver.Server$ContentDirectoryProvider.browse(Server.java:9861)
at org.openhome.net.device.providers.DvProviderUpnpOrgContentDirectory1$DoBrowse.ac​tionInvoked(DvProviderUpnpOrgContentDirectory1.java:978)


RE: Comparison method violates its general contract! - simoncn - 10-03-2013 08:22

(10-03-2013 02:26)Mike48 Wrote:  I don't know what to make of this:

Sat Mar 09 17:20:09 MinimServer: exception while processing action request: java.lang.IllegalArgumentException: Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeHi(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeForceCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.minimserver.Server.sortAlbumList(Server.java:3461)
at com.minimserver.Server.access$10700(Server.java:84)
at com.minimserver.Server$AlbumListView.init(Server.java:9059)
at com.minimserver.Server$AlbumListView.<init>(Server.java:8995)
at com.minimserver.Server$AlbumListContainer.populate(Server.java:9150)
at com.minimserver.Server.populateContainer(Server.java:3440)
at com.minimserver.Server.access$12600(Server.java:84)
at com.minimserver.Server$ContentDirectoryProvider.doBrowse(Server.java:9906)
at com.minimserver.Server$ContentDirectoryProvider.browse(Server.java:9861)
at org.openhome.net.device.providers.DvProviderUpnpOrgContentDirectory1$DoBrowse.ac​tionInvoked(DvProviderUpnpOrgContentDirectory1.java:978)

I think I know what's causing this. It's related to a recent change I made to "improve" the sort algorithm for albumSortTags. I'll do some investigations and I'll post more information here when I have it.


RE: Comparison method violates its general contract! - simoncn - 10-03-2013 21:09

Hi Mike,
This problem will occur only if all the following apply:

1) You're using the test build that fixes the problem with apostrophes

2) You're using Java 7

3) You've changed albumSortTags from the default value, and you've included a tag that is populated for some of your albums but not all of them

I've got a new test build that should fix the problem. I'll send you a PM with details of where to find it.

Simon


RE: Comparison method violates its general contract! - luite - 30-03-2013 18:17

Similar Issue for me - Suggestions or a PM linking to a test build ? :-)

- Installed minimserver on ReadyNas duo v2 as per instructions today
- java 7 on ARM 5 (ejre-7u10-fcs-b18-linux-arm-sflt-headless-28_nov_2013)
- MinimServer-0.63-readynas-arm.bin
- no changes to tag settings (albumsorttag = Album, Artist)
- changed the ohnet.port to 9791
- I do have audiofiles with custom tags

java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(TimSort.java:747)
at java.util.TimSort.mergeAt(TimSort.java:483)
at java.util.TimSort.mergeCollapse(TimSort.java:410)
at java.util.TimSort.sort(TimSort.java:214)
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 com.minimserver.Server$Album.sortItems(Server.java:7890)
at com.minimserver.Server.constructAlbum(Server.java:2678)
at com.minimserver.Server.scanFiles(Server.java:2549)
at com.minimserver.Server.scanFiles(Server.java:2568)
at com.minimserver.Server.scanFiles(Server.java:2568)
at com.minimserver.Server.scanFiles(Server.java:2568)
at com.minimserver.Server.scanFiles(Server.java:2568)
at com.minimserver.Server.readFiles(Server.java:2038)
at com.minimserver.Server.doStart(Server.java:1327)
at com.minimserver.Server.start(Server.java:449)
at org.jminim.core.ContextImpl.startComponent(ContextImpl.java:155)
at org.jminim.core.ContextImpl.start(ContextImpl.java:83)
at org.jminim.core.RootContextImpl.startComponent(RootContextImpl.java:36)
at org.jminim.core.ContextImpl.start(ContextImpl.java:83)
at org.jminim.core.RuntimeImpl.run(RuntimeImpl.java:377)
at org.jminim.core.LauncherImpl.run(LauncherImpl.java:634)
at org.jminim.core.LauncherImpl.launch(LauncherImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav​a:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jminim.launch.Launcher.launch(Launcher.java:64)
at com.minimserver.launch.LaunchServer.main(LaunchServer.java:18)


RE: Comparison method violates its general contract! - simoncn - 30-03-2013 18:52

(30-03-2013 18:17)luite Wrote:  Similar Issue for me - Suggestions or a PM linking to a test build ? :-)

- Installed minimserver on ReadyNas duo v2 as per instructions today
- java 7 on ARM 5 (ejre-7u10-fcs-b18-linux-arm-sflt-headless-28_nov_2013)
- MinimServer-0.63-readynas-arm.bin
- no changes to tag settings (albumsorttag = Album, Artist)
- changed the ohnet.port to 9791
- I do have audiofiles with custom tags

I'm surprised that this could occur using 0.63.5. I'll PM you a link to a test build to try.

Which platform are you using to run MinimWatch? (The test build requires an update to MinimWatch.)


RE: Comparison method violates its general contract! - luite - 30-03-2013 19:04

(30-03-2013 18:52)simoncn Wrote:  I'm surprised that this could occur using 0.63.5. I'll PM you a link to a test build to try.

Which platform are you using to run MinimWatch? (The test build requires an update to MinimWatch.)

Appreciate your support! I've got minimwatch on either on ubuntu Quantal or windows 8

root@e6400:~# uname -a
Linux e6400 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 i686 i686 i686 GNU/Linux


RE: Comparison method violates its general contract! - simoncn - 30-03-2013 19:38

(30-03-2013 19:04)luite Wrote:  Appreciate your support! I've got minimwatch on either on ubuntu Quantal or windows 8

root@e6400:~# uname -a
Linux e6400 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 i686 i686 i686 GNU/Linux

For Windows 8, are you using the x86 or x64 version of MinimWatch?


RE: Comparison method violates its general contract! - luite - 05-04-2013 19:57

FYI Simon fixed the issue for me in a new test version. I'm sure this'll find it's way to the next release.
Thanks Simon!