3
When trying to run a report that contains a fixed image on an Amazon linux server. The exception appears below. Someone has already been through it ?
Caused by: java.awt.HeadlessException: No X11 DISPLAY variable was set, but
this program performed an operation which requires it. at
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204) at
java.awt.Window.<init>(Window.java:536) at java.awt.Frame.<init>
(Frame.java:420) at java.awt.Frame.<init>(Frame.java:385) at
javax.swing.JFrame.<init>(JFrame.java:189) at
net.sf.jasperreports.view.JasperViewer.<init>(JasperViewer.java:267) at
net.sf.jasperreports.view.JasperViewer.viewReport(JasperViewer.java:655) at
net.sf.jasperreports.view.JasperViewer.viewReport(JasperViewer.java:587) at
net.sf.jasperreports.view.JasperViewer.viewReport(JasperViewer.java:535) at
util.report.ExecutorComprovante.execute(ExecutorComprovante.java:49) ... 51
more
If I set Display with this command: export DISPLAY=:0.0 The Display exception changes and shows only Caused by: java.awt.Headlessexception at java.awt.Graphicsenvironment.checkHeadless(Graphicsenvironment.java:204) at java.awt.Window. <init>(Window.java:536) at java.awt.Frame. <init>(Frame.java:420) at java.awt.Frame. <init>(Frame.java:385) at javax.swing.Jframe. <init>(Jframe.java:189) at net.sf.jasperreports.view.Jasperviewer. <init>(Jasperviewer.java:267) at
– Láion Dorleto
Edit the question on the button
Editar
below thetags
and complements.– rubStackOverflow
Just to confirm, which distro are you using? Ubuntu? Amazon Linux?
– sergiopereira