Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4936074

1.5.0 Regression: Printing fails in headless mode.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • client-libs
    • 2d
    • b26
    • x86, sparc
    • solaris_2.6, windows_nt

      The new JTable printing API (final putback awaiting approval) should support printing in headless mode. While trying to test against the Swing workspace, printing failed every time with a hotspot error. On discovering this, I wrote up a simple test case that does nothing more than try to print 10 pages to a file (test case attached).

      The test should be run with the flag -Djava.awt.headless=true

      When run against 1.4.2, the test succeeds.

      When run against 1.5.0 b23 it fails with the following stack trace:

      java.lang.IllegalArgumentException: Invalid Image variant
              at sun.awt.image.SurfaceManager.getManager(SurfaceManager.java:47)
              at sun.java2d.SurfaceData.getDestSurfaceData(SurfaceData.java:112)
              at sun.java2d.SunGraphicsEnvironment.createGraphics(SunGraphicsEnvironme
      nt.java:327)
              at sun.java2d.HeadlessGraphicsEnvironment.createGraphics(HeadlessGraphic
      sEnvironment.java:77)
              at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1055)
              at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1619)
              at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1204)
              at HeadlessPrintingTest.main(HeadlessPrintingTest.java:30)

      When run against the current Swing workspace, it produces a hotspot error with the following text, and a hotpot error log which is attached:

      Page 0
      Page 0
      #
      # An unexpected error has been detected by HotSpot Virtual Machine:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d61cebc, pid=192, tid=184
      #
      # Java VM: Java HotSpot(TM) Client VM (1.5.0-beta-b23 mixed mode)
      # Problematic frame:
      # V [jvm.dll+0x8cebc]
      #
      # An error report file with more information is saved as hs_err_pid192.log
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #

      ###@###.### 2003-10-10

            chaasesunw Chet Haase (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: