JDK-8042693 : [macosx] Print problems from OS X browsers
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u25,8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2013-08-14
  • Updated: 2017-01-31
  • Resolved: 2017-01-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorResolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
  From console:
Java Plug-in 10.25.2.15
Using JRE version 1.7.0_25-b15 Java HotSpot(TM) 64-Bit Server VM

ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.8.4

EXTRA RELEVANT SYSTEM CONFIGURATION :
Tried from both Firefox and Safari. Bug appears from both browsers. Works fine on Firefox on Windows.


A DESCRIPTION OF THE PROBLEM :
Printing in Java from many sites produces blank pages. This happens on Mac only; no problem from Windows, so I assume that this is a Mac-specific bug. See e.g. the following State of Michigan sites:

http://www.dleg.state.mi.us/bcs_corp/sr_corp.asp
http://www.dleg.state.mi.us/platmaps/sr_subs.asp

Upon printing, the console reports:

Printing exception null
java.lang.StackOverflowError
at sun.java2d.CRenderer.doImage(Native Method)
at sun.java2d.OSXSurfaceData.blitImage(OSXSurfaceData.java:1025)
at sun.java2d.CRenderer.blitImage(CRenderer.java:461)
at sun.java2d.CRenderer.scaleImage(CRenderer.java:455)
at sun.java2d.CRenderer.scaleImage(CRenderer.java:401)
at sun.java2d.CRenderer.scaleImage(CRenderer.java:557)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3047)
at sun.awt.image.ImageRepresentation.drawToBufImage(ImageRepresentation.java:845)
at sun.java2d.CRenderer.scaleImage(CRenderer.java:562)
at sun.java2d.pipe.ValidatePipe.scaleImage(ValidatePipe.java:207)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3047)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2996)
at sun.print.ProxyGraphics2D.drawImage(ProxyGraphics2D.java:856)
at sun.print.ProxyGraphics.drawImage(ProxyGraphics.java:861)
at com.acordex.vtj.u.a(Unknown Source)
at com.acordex.vtj.d.for(Unknown Source)
at com.acordex.vtj.d.run(Unknown Source)
at java.lang.Thread.run(Thread.java:724)

Before printing, when loading Java, the console also reported the following:

Missing Permissions manifest attribute for: http://www.dleg.state.mi.us/bcs_corp/javabin/TIFFView.jar
Missing Codebase manifest attribute for: http://www.dleg.state.mi.us/bcs_corp/javabin/TIFFView.jar



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
At the above sites, lookup any corporation report or plat map and try to print.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A printout.
ACTUAL -
Blank page.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
See above.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
No access to source code.
---------- END SOURCE ----------
Comments
The problem was fixed under JDK-8163889
31-01-2017

Java2d code in Java_sun_lwawt_macosx_CPrinterJob_printLoop states that this method must be called on non-Aprkit thread, and in the same moment the code in awt AWTWindow canBecomeKeyWindow states that it should be called on the Appkit thread only.
12-01-2015

Reassigning back to AWT team for the AppKit issue
11-06-2014

Reassigning to AWT team to investigate the AppKit thread issue.
09-05-2014

The above issue also killed the Dock until I quit Safari.
09-05-2014

Safari needs to run the applet outside of the sandbox to be able to print. This seems to have uncovered another issue, I got an error in AWT (in 8u20): 5/9/14 9:48:09.427 AM java[43984]: Cocoa AWT: Not running on AppKit thread 0 when expected. ( 0 libawt_lwawt.dylib 0x00000001e49aedfd -[AWTWindow canBecomeKeyWindow] + 42 1 libawt_lwawt.dylib 0x00000001e49acdd1 -[AWTWindow_Panel canBecomeKeyWindow] + 33 2 AppKit 0x00007fff94961288 -[NSWindow _visibleAndCanBecomeKeyLimitedOK:] + 106 3 AppKit 0x00007fff94a3f29e -[NSWindow _orderOutAndCalcKeyWithCounter:stillVisible:docWindow:] + 783 4 AppKit 0x00007fff94969149 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 3218 5 AppKit 0x00007fff94968038 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 940 6 AppKit 0x00007fff94967c1f -[NSWindow orderWindow:relativeTo:] + 159 7 AppKit 0x00007fff94aea74e _NXDoLocalRunAlertPanel + 458 8 AppKit 0x00007fff94aea56c NSRunAlertPanel + 157 9 AppKit 0x00007fff94f2c30a -[NSView(NSPrintingInternal) _printForCurrentOperation] + 689 10 AppKit 0x00007fff94d16a98 -[NSConcretePrintOperation _renderView] + 277 11 AppKit 0x00007fff94d170ec -[NSConcretePrintOperation runOperation] + 357 12 libawt_lwawt.dylib 0x00000001e49e6561 -[PrintModel safePrintLoop:withEnv:] + 160 13 libawt_lwawt.dylib 0x00000001e49e6617 -[PrintModel runPrintLoopWithView:waitUntilDone:withEnv:] + 117 14 libawt_lwawt.dylib 0x00000001e49c867a Java_sun_lwawt_macosx_CPrinterJob_printLoop + 623 15 ??? 0x000000010938593a 0x0 + 4449655098 16 ??? 0x00000001093625a0 0x0 + 4449510816 17 ??? 0x0000000109362dcd 0x0 + 4449512909 )
09-05-2014

Could not reproduce with 7u65 on 10.8.5 in Safari 6.0.1 Additionally, it seems TIFFView.jar has been updated and now includes Permissions and Codebase attributes (which could have been the source of the problem).
09-05-2014