Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

NullPointerException upon printing

0 votes
Upon trying to print I get a NullPointerException from java. I've tried upating java. I updated to the latest yEd. Neither have fixed the problem.

 

java.lang.NullPointerException
    at java.desktop/sun.print.RasterPrinterJob.setAttributes(RasterPrinterJob.java:1280)
    at java.desktop/sun.awt.windows.WPrinterJob.setAttributes(WPrinterJob.java:696)
    at java.desktop/sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1550)
    at java.desktop/sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1483)
    at com.yworks.A.B.P.F$E.ă(Unknown Source)
    at com.yworks.A.B.P.F$A.ā(Unknown Source)
    at com.yworks.A.A.C.A.ā(Unknown Source)
    at com.yworks.A.A.C.A.ą(Unknown Source)
    at com.yworks.A.A.C.A$1.run(Unknown Source)
    at com.yworks.A.A.D.E.ā(Unknown Source)
    at com.yworks.A.K.j.actionPerformed(Unknown Source)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
    at java.desktop/java.awt.Component.processEvent(Component.java:6397)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
in Help by (120 points)

1 Answer

0 votes

This is actually an error in Java's printing framework that has been introduced with Java 9: JDK-8221411 : NullPointerException in RasterPrinterJob without PrinterResolution.

Other users of yEd have been able to workaround this problem by running yEd on Java 8 instead of Java 9/10/11/12. Thus if you do not need Windows display scaling, the yEd installer with embedded Java 8 runtime environment might be an option for you. Said Java 8 installer is available from the yEd download page.
Another option would be printing to a PDF printer or exporting your diagram to a PDF or SVG file and use a PDF/SVG viewer application for printing.

by [yWorks] (146k points)
Legal Disclosure | Privacy Policy
...