Jump to content
Changes to the Jaspersoft community edition download ×

Problem with PDF generation on Unix

2005 IR Help

Recommended Posts

By: Constantin Szallies - szallies

Problem with PDF generation on Unix

2004-07-22 04:35

Hello everybody,


my PDF generation works on windows but not on

UNIX. I get the following exception:




java.lang.InternalError: Can't connect to X11 window server using '' as the value of the DISPLAY variable.

at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:125)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:140)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)

at dori.jasper.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:102)

at dori.jasper.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:211)

at dori.jasper.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:124)

at dori.jasper.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:116)

at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:151)

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:353)

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:293)



It looks like jasperReports needs an X-Window server to work properly!


1) Is there any way to cut this dependency to X11?

2) If no, what to do? There's X running on the machine with the mentioned IP adress.


Greetings Constantin






By: Darran Smith - darrans

RE: Problem with PDF generation on Unix

2004-07-22 05:06

There's a couple of things you can do.


If you're running Java 1.4 (I think) or above, then you can use the following command in your Java code to export to PDF without requiring an X server to be running:


System.setProperty("java.awt.headless", "true");


Alternatively, given you've got an xserver running anyways, you could try doing "xhost +" which will allow any user to connect to the xserver.




Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...