NWDS 7.5 Error: Comparison method violates its general contract!
Hi all,
i came across a strange error last week and it cost me a lot of time and nerves. I had created a BPM model with custom tech tasks, as usual I imported some complex types from ESR and set them as in / output structure. When the structure changed and i tried to re-open the wizard for custom tech… nothing happened. I restarted NWDS several times, “reinstalled” it, tried different versions etc. I clicked the hell out of this button but nothing happened. The log gave me the same error every time:
I searched around in SCN for a solution but could not find any. So i was stalking a bit in the Eclipse community and found this Bug report:
–> https://bugs.eclipse.org/bugs/show_bug.cgi?id=361121
According to this, the error occurs due to badly implemented comparators which where silently ignored in Java 1.6 but since 1.7 they crash. Because i can’t do any changes on the SAP Plugins, the workaround was quite simple. Allow the arrays util to use LegacyMergeSort. Just add “-Djava.util.Arrays.useLegacyMergeSort=true” to your ini file and it works again. Issue took so much time and the solution was that easy. I hope SAP is working on this one.
Have fun.
BR,
Tobias
had this problem 10 minutes ago and found luckily your post. thx a lot! you saved lots of time
You’re welcome. Glad that I could help you.
Thank you Tobias! Just had this error and it worked!
You just saved me a lot of time 🙂
Many thanks Tobias !!
Thanks!!!!!
Hi Tobias,
I am experiencing exactly the same behaviour and getting frustrated.
When adding your recommended parameter to my eclipse.ini, Eclipse won't start anymore. Where and how should it be added to the file?
Thanx a mil.
At the Moment my eclipse.ini reads as follows:
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m
Hi Rene, sorry for the late reply but i have been on vacation for the last two weeks. I just added it on the end of the ini file:
[...]
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m
-Djava.util.Arrays.useLegacyMergeSort=true
You helped me alot with this tip!!
Tx. Tobias,
all working fine.
Regards, Rene
Hi Tobias,
Do you know if its Java 1.8 .. Same trick works ?
I am having 1.8 and with this parameter in the ini file NWDS still continues to give me the issue "Comparison method violates its general contract!" with a Data Object
-Regards
Hi Mahesh,
yes it does. Actually i have only used it for Java 8 on 7.5 stack and never on Java 7. Please make sure you add it at the end of the ini file and copy it correctly:
-Djava.util.Arrays.useLegacyMergeSort=true
Best regards,
Tobias
Works Perfect.
Thanks Tobias for sharing.
Regards,
Antony.
Thanks a lot for sharing the solution; this helped save time and effort.
Regards,
Lok
Thank you very much!
Best regards!
Alex.
Saved me!
Thx
Thanks a lot. Saved me a lot of time.
Thanks a lot. Saved one more!!!
Thank you very much! Registered to thank!
You're welcome Igor. Glad that I could help you.
Thanks Lot..,
Please explain detail steps where this add and how to add please