Cannot connect to X11 window exception

By: Kevin Chen - kchena2w
Cannot connect to X11 window exception
2003-02-24 12:05
I'm using JasperReports on the server side (weblogic server) to generate report for a webapp. I got the following exceptions:

java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
at java.awt.Font.initializeFont(
at java.awt.Font.<init>(
at java.awt.Font.getFont(
at sun.java2d.SunGraphicsEnvironment.getBestFontFor(
at java.awt.font.TextLine$ACIFontSource.getBestFontAt(
at java.awt.font.TextLine.getComponents(
at java.awt.font.TextMeasurer.generateComponents(
at java.awt.font.TextMeasurer.initAll(
at java.awt.font.TextMeasurer.<init>(
at java.awt.font.LineBreakMeasurer.<init>(
at java.awt.font.LineBreakMeasurer.<init>(
at dori.jasper.engine.fill.JRFillTextElement.chopTextElement(
at dori.jasper.engine.fill.JRFillTextField.prepare(
at dori.jasper.engine.fill.JRFillBand.prepareElements(
at dori.jasper.engine.fill.JRFillBand.fill(
at dori.jasper.engine.fill.JRVerticalFiller.fillTitle(
at dori.jasper.engine.fill.JRVerticalFiller.fillReportStart(
at dori.jasper.engine.fill.JRVerticalFiller.fillReport(
at dori.jasper.engine.fill.JRBaseFiller.fill(
at dori.jasper.engine.fill.JRBaseFiller.fill(
at dori.jasper.engine.fill.JRFiller.fillReport(
at dori.jasper.engine.JasperFillManager.fillReport(

The code I used to fill report in my sevlet is like:

File reportFile = new File(reportFileName);
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());
Map parameters = new HashMap();
parameters.put("BaseDir", reportFile.getParentFile());
parameters.put("StartingTime", new Long(start.getTime()));
parameters.put("EndingTime", new Long(end.getTime()));
parameters.put("StartingTimeString", "Starting Time: "+startStr);
parameters.put("EndingTimeString", "Ending Time: "+endStr);
parameters.put("MaxRowNums", "300000");

Connection conn = DBUtils.getConnection();

JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport,


By: Matt Hall - matt2k
RE: Cannot connect to X11 window exception
2003-02-24 14:40

I am also having this problem when trying to generate a report in HTML format, when I try to generate the report for PDF or Excel I get a different NoClassDefFoundException on line 109.

I wasn't aware of needing to configure any displays on the server to generate reports, I'm going to reread the documentation to see if there's any mention made.


By: Kevin Chen - kchena2w
Found a solution
2003-02-24 14:52
Please see the previous thread on this issue at I followed Rick Sperko's suggestion and used PJA to bypass the issue. I have to add two additional sys property settings to make it work:



By: Eric Tan - neltan
RE: Cannot connect to X11 window exception
2003-02-24 23:17
Please read the previous thread. You'll solve it!
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 17 years 1 month ago

0 Answers:

No answers yet