Bug 53887 - -awt command line option broken throwing HeadlessException
Summary: -awt command line option broken throwing HeadlessException
Status: RESOLVED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: awt renderer (show other bugs)
Version: trunk
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 54164 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-18 12:06 UTC by Ralph Hummeling
Modified: 2012-11-18 17:28 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Hummeling 2012-09-18 12:06:09 UTC
The AWTRenderer won't appear from the command line throwing a HeadlessException

>fop -fo examples\fo\basic\normal.fo -awt

18-Sep-2012 14:00:42 org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.awt.HeadlessException
        at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
        at java.awt.Window.<init>(Unknown Source)
        at java.awt.Frame.<init>(Unknown Source)
        at java.awt.Frame.<init>(Unknown Source)
        at javax.swing.JFrame.<init>(Unknown Source)
        at org.apache.fop.render.awt.viewer.PreviewDialog.<init>(PreviewDialog.java:110)
        at org.apache.fop.render.awt.viewer.PreviewDialog.createPreviewDialog(PreviewDialog.java:275)
        at org.apache.fop.render.awt.AWTRenderer.<init>(AWTRenderer.java:99)
        at org.apache.fop.cli.CommandLineOptions.parse(CommandLineOptions.java:211)
        at org.apache.fop.cli.Main.startFOP(Main.java:161)
        at org.apache.fop.cli.Main.main(Main.java:208)
Comment 1 Chris Bowditch 2012-09-21 10:35:15 UTC
Thanks for the bug report. I confirm that this issue exists in FOP v1.1rc when running on a Windows machine which clearly has a Graphics environment available.
Comment 2 Mehdi Houshmand 2012-09-24 09:19:56 UTC
This also happens in trunk in a linux environment (Ubuntu 12.04 3.2.0-30-generic). I'll take a look
Comment 3 Mehdi Houshmand 2012-09-24 10:04:06 UTC
Ok, I took a quick look at this, and it seems to be caused by bug#50062.

Glenn, would you be alright with me reverting this change? Users can add the "-Djava.awt.headless=true" as Chris suggested, but this shouldn't be the default as it blocks invocation of the AWT renderer.
Comment 4 Mehdi Houshmand 2012-09-26 08:51:32 UTC
This has been fixed in r1390331. Please could you make sure that it works on your machine and set the status to fixed if you're happy.

Thanks.
Comment 5 Ralph Hummeling 2012-09-27 20:45:14 UTC
Confirmed AWT command line option repaired.
Comment 6 Glenn Adams 2012-11-18 17:28:03 UTC
*** Bug 54164 has been marked as a duplicate of this bug. ***