Skip to Content
Author's profile photo Hamdorf Tobias

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:

CampareBug1.png

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

Assigned Tags

      20 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      had this problem 10 minutes ago and found luckily your post. thx a lot! you saved lots of time

      Author's profile photo Tobias Hamdorf
      Tobias Hamdorf
      Blog Post Author

      You’re welcome. Glad that I could help you. 

      Author's profile photo Jesus Bohorquez
      Jesus Bohorquez

      Thank you Tobias! Just had this error and it worked!

      Author's profile photo Hans Hougaard
      Hans Hougaard

      You just saved me a lot of time 🙂

      Many thanks Tobias !!

      Author's profile photo Former Member
      Former Member

      Thanks!!!!!

      Author's profile photo Rene Funke
      Rene Funke

      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

      Author's profile photo Tobias Hamdorf
      Tobias Hamdorf
      Blog Post Author

      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

      Author's profile photo Former Member
      Former Member

       

      You helped me alot with this tip!!

      Author's profile photo Rene Funke
      Rene Funke

       

      Tx. Tobias,

      all working fine.

      Regards, Rene

      Author's profile photo Mahesh Sheth
      Mahesh Sheth

      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

      Author's profile photo Tobias Hamdorf
      Tobias Hamdorf
      Blog Post Author

      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

      Author's profile photo antony ferminus
      antony ferminus

      Works Perfect.

      Thanks Tobias for sharing.

       

      Regards,

      Antony.

      Author's profile photo lok y
      lok y

       

      Thanks a lot for sharing the solution; this helped save time and effort.

      Regards,

      Lok

      Author's profile photo Alex Komarov
      Alex Komarov

      Thank you very much!

       

      Best regards!

      Alex.

      Author's profile photo MILTIADIS KOUVARAS
      MILTIADIS KOUVARAS

      Saved me!

      Thx

      Author's profile photo Ncube Beki
      Ncube Beki

      Thanks a lot. Saved me a lot of time.

      Author's profile photo Diego Frozza Compagnoni
      Diego Frozza Compagnoni

      Thanks a lot. Saved one more!!!

      Author's profile photo Igor Esse
      Igor Esse

      Thank you very much! Registered to thank!

      Author's profile photo Hamdorf Tobias
      Hamdorf Tobias
      Blog Post Author

      You're welcome Igor. Glad that I could help you.

      Author's profile photo apparao a
      apparao a

      Thanks Lot..,