• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PDFbox gives headless exception

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am tying to create a site that at one point automatically opens the browsers printing dialog box with a streamed PDF.
It currently works on my machine but when we deploy to the test server i get the error:

java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it. at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:401)
     at org.pdfbox.pdmodel.PDDocument.print(PDDocument.java:......

Can someone please help me solve this.

Thanks.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm having the same problem. Did you ever resolve this?

Thanks
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The usual approach would be to start the JVM in headless mode using the parameter "-Djava.awt.headless=true".
 
reply
    Bookmark Topic Watch Topic
  • New Topic