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

REG: Printing from multiple threads throws Exception when printer is busy

XMLWordPrintable

    • 2d
    • b63
    • x86, sparc
    • linux_redhat_4.0, solaris_9
    • Verified

      I am printing an image to the same print service from 2 different threads where each thread maintains it's own print data and DocPrintJob. When the printer is busy printing a huge document or currently waiting for user input, this multithread test throws a PrintJobFlavorException saying invalid flavor. The flavor is actually supported by the printer and this application works fine when printer is not busy.

      This is reproducible only on Solaris / Linux systems and not reproducible on win32 platforms. I executed this application on Tiger-beta-b09 and the application waits for a long time to complete. When I execute the same application on Tiger-beta-b30, I am getting this exception. I am using a Xerox Docuprint N4025 printer and I have CUPS installed on my machine. I tested this with Solaris 9, JDS and Linux RH 9 and I am able to reproduce the problem.

      I have attached a test. Execute it as follows:
      java MultiThreadTest fish.gif
      Before running this command, make the printer busy. Probably the easy way to to do this is to make the printer wait for user input by changing the default media size. When I do that, my printer (Xerox Docuprint N4025) waits and asks the user whether it can use the default paper. During that time, I get the exception when I run the attached multithread test.

      Here is the exception:
      sun.print.PrintJobFlavorException: invalid flavor
       at sun.print.UnixPrintJob.print(UnixPrintJob.java:306)
       at MultiThreadTest.print(MultiThreadTest.java:25)
       at MultiThreadTest.run(MultiThreadTest.java:34)

      I could not trace out the build in which this was introduced, though i could figure out that it is introduced between b10 - b29 (both inclusive).

            jgodinez Jennifer Godinez (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: