JDK-6390756 : Printing from multiple threads throws incorrect exception on Linux-AMD64
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_redhat_4.0
  • CPU: x86
  • Submitted: 2006-02-26
  • Updated: 2010-04-02
  • Resolved: 2006-03-13
Related Reports
Duplicate :  
Relates :  
Description
I am trying to print a GIF image from 2 different threads using DocPrintJob. When I run this on RHEL4-AMD64, I am getting an exception when printing from the second thread. The exception keep changings when running multiple times successively. However, the 2 exceptions given below are the ones that alternate. One of the exceptions claims that flavor is unsupported. But flavor is indeed supported - 

java.lang.NullPointerException
at sun.print.IPPPrintService.findCustomMedia(IPPPrintService.java:841)
at sun.print.UnixPrintJob.print(UnixPrintJob.java:328)
at MultiThreadTest.print(MultiThreadTest.java:32)
at MultiThreadTest.run(MultiThreadTest.java:41)

sun.print.PrintJobFlavorException: invalid flavor
at sun.print.UnixPrintJob.print(UnixPrintJob.java:313)
at MultiThreadTest.print(MultiThreadTest.java:32)
at MultiThreadTest.run(MultiThreadTest.java:41)

This is reproducible on Mustang as well as Tiger-FCS. I reproduced it with Mustang-n73, b59g on RHEL4-AMD64. This does not happen when I use linux-i586 build and occurs only on linux-amd64 build. 

I have attached a sample test and an image.  Run the test passing the image file as an argument to the test. You will see the exception on the console. If it does not happen the first time, try running the test 2-3 times successively and you will see that exception when printer becomes busy.

Comments
EVALUATION I ran this test using 1.6.0-ea-b35 and I was able to reproduce the PrintJobFlavorException which btw is the same exception as 4997933. I ran the latest promoted build beta2-b75 and I could not reproduce it anymore so this is already fixed. Closing this as dup of 4997933.
13-03-2006