Print Report

When right clicking on the report screen and choosing print, I’m getting this error…

Comparison method violates its general contract!

Any ideas? I’m on version 7.5.12 running Java 7u75

Heres the full code…

[code]java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeLo(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeCollapse(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 sun.java2d.Spans.sortAndCollapse(Unknown Source)
at sun.java2d.Spans.intersects(Unknown Source)
at sun.print.PeekGraphics.hitsDrawingArea(Unknown Source)
at sun.print.RasterPrinterJob.printPage(Unknown Source)
at sun.print.RasterPrinterJob.print(Unknown Source)
at com.inductiveautomation.factorypmi.application.print.FPMIPrinterJob.print(FPMIPrinterJob.java:448)
at com.reportmill.RMViewer.print(RMViewer.java:1001)
at com.inductiveautomation.factorypmi.plugins.reporting.components.ReportBase.print(ReportBase.java:153)
at com.inductiveautomation.factorypmi.plugins.reporting.components.ReportBase.print(ReportBase.java:142)
at com.inductiveautomation.factorypmi.plugins.reporting.components.ReportPanel$1.actionPerformed(ReportPanel.java:70)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$300(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Ignition v7.5.13 (b1571)
Java: Oracle Corporation 1.7.0_75
[/code]

This might only be a problem with Java 7. Java 7 had a change that causes this error to occur. You might want to try updating your Java version to a higher version. You could try Java 8.

Or you could try the following:
Add -Djava.util.Arrays.useLegacyMergeSort=true as an argument to Java when when your client is started. More information here: dertompson.com/2012/11/23/sort-a … in-java-7/

I don’t think Java 8 works on the version I’m on. I had to drop from 8 to 7 to get it to work.

Shall I drop down to 6 ?

I’ll try adding the argument first. Having said that, I get the error when using the right click print option. Could i script it differently ?

Thankyou.

This is the code for the client launcher.

[code]<?xml version="1.0" encoding="utf-8"?>



Mobile Spoolbase
Inductive Automation
























[/code]

Where in there do I add the new argument ?

Try sticking this property in there under the existing properties:

<property name="java.util.Arrays.useLegacyMergeSort" value="true"/>

If that doesn’t work then use a native client launcher to create a shortcut to your project. Then add -Djava.util.Arrays.useLegacyMergeSort=true to the target of the shortcut. Here’s an example:

C:\Users\nick\Desktop\clientlauncher.exe scope=C project=CompanyProject windowmode=window gateway.addr=192.168.1.4:8088:8043 -Djava.util.Arrays.useLegacyMergeSort=true

Let me know how it goes.
Best,

Adding the property worked…

Thanks Nick.