Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4450194
Votes 10
Synopsis Applet can only be printed one at a time
Category java:classes_awt
Reported Against ladybird-rc2 , merlin-beta2
Release Fixed
State 11-Closed, Not Reproducible, bug
Priority: 4-Low
Related Bugs 4497928
Submit Date 25-APR-2001
Description
How are you printing these applets? Are you using the native print
dialog or the browsers print dialog (File -> Print or Print icon in toolbar)?
If you are not using the browsers print what happens when you do try to 
print using the browsers print? Does the browser crash with a bus error
message?

Do you know if this is a regression?

  xxxxx@xxxxx   2001-04-26Browser:  Netscape 4.75
OS:  Redhat 6.2
JDK:  Ladybird b22

I need to close and restart Netscape if I want to print more than one applet.  

To reproduce:

- Go to page http://sqesvr.eng.sun.com/deployment1/ws/doc/proc/JPI_printing.html

- Go to link for Test Case #1 and print applet.

- Then go to link for Test Case #2 and print another applet.

The Test Case #1 applet gets printed fine but not the Test Case #2 applet.  The
order doesn't matter.  If I printed #2 first, then #1 didn't get printed.
I also tried printing the same applet twice.  Both copies got printed fine.  

It only happens after one applet is printed and then I load another applet to
print.  The 2nd applet never gets printed.

******** Additional Info ********

I'm using native print dialog to print these applets.  If I use the Netscape
browser's print dialog, the browser crashes with bus error.  I just tried
reproducing this on Firefly.  Yes, it also fails on Firefly the exact same way.
  xxxxx@xxxxx   10/8/04 08:18 GMT
Work Around
Go to the /tmp directory. There should be 1 or more javaprint#####.ps
files. The file with the higher number is the last one that was generated
(or you can check the date/time of the file).
Do lp (or lpr) javaprint#####.ps to print the file.
  xxxxx@xxxxx   2001-04-26
Evaluation
Using merlin b73 the printDialog and pageDialog do not show up on Linux. 
This started to happen a few builds back. I think it might have something 
to do with bug 4479471 os.name property changed on Linux in merlin build 71
(see also bug 4479834).

I used the Adobe Acrobat Reader plugin to see if I could get the same behavior with print. At times the pdf file would not print after doing a previous print. Sometimes I would get below error.
ERROR: limitcheck
OFFENDING COMMAND: --nostringval--
STACK:

Printed pdf files (printtmp.xxxxxx) are also found in the /tmp directory.

There is a option (-r) for lpr that will delete the files after spooling them.
I tried this and it didn't seem to have any affect.

The lpd.lock file is found in the /var/spool/lpd directory.

  xxxxx@xxxxx   2001-07-25

-----------------------------------------------------------------------------

Using merlin b74 you can print more than 1 applet. But after printing a few 
applets the print dialog no longer comes up. When you click on the print button, found in the test, you get exceptions thrown (in the java console).

java.lang.NullPointerException
at sun.awt.SunToolkit.postEvent(SunToolkit.java:274)
at java.awt.DefaultKeyboardFocusManager.sendMessage(DefaultKeyboardFocusManager.java:167)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:487)
at java.awt.Component.dispatchEventImpl(Component.java:3379)
at java.awt.Container.dispatchEventImpl(Container.java:1440)
at java.awt.Window.dispatchEventImpl(Window.java:1531)
at java.awt.Component.dispatchEvent(Component.java:3349)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:439)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:97)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:437)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:131)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

  xxxxx@xxxxx   2001-07-30

-----------------------------------------------------------------------------

The above exception happens when performing other tasks with the plugin.
See bug 4486078 for an example. This problem pretty much makes the plugin
unusable. Once this awt problem is fixed this bug should be able to be closed
(since I was able to print more than 1 applet).

I ran into some other bugs while looking at this bug.
4411479 Java Printing not working on Red Hat Linux 7.0 
4456857 Linux: No dialog pops up with PrinterJob.pageDialog() and PrinterJob.printDialog
4479471: os.name property changed on Linux in merlin build 71
4479834 Need a new system properties os.variant to give more os info on linux
4486078 HTTPS test cases throws Null pointer Exception

Before printing make sure the lpd print daemon is running and the printer is working. At times, while looking at this bug, the lpd has been down and the printer not responding (see below). 

lpq
Warning: <printername> is down: Failed to open the printer port. (Device busy)

Use from the below print commands to resolve any printer problems.

Other print commands (usually found in /usr/bin, /usr/sbin):
lpc  print control program (type help for commands)
lpq  spool queue examination program
lpr  print command
lprm  remove jobs from spooling queue
lpunlock  script to unhang a printer which claims it is "waiting for a lock"
printtool program to add and configure printers on the system

  xxxxx@xxxxx   2001-08-01

---------------------------------------------------------------------------

Bug 4497928 (page & print dialogs do not come up on linux) is a problem
now. I'm reassigning this bug (4450194) to the awt team.

  xxxxx@xxxxx   2001-09-05

=======================================

I've been testing this on RH Linux 6.1 using merlin b80. I've rebuilt
the JRE and added some instrumentation. I also rebuilt the applets and
added print statements there too. My JRE is up to date with b81.
What I am seeing is that for the test PrintDialog_Plugin the AWT button
that must be pressed to invoke the print dialog isn't even seeing the button
event. The button does show the highlighting that indicates its depressed
but there's no AWT events coming from it.
That test also has a textfield which doesn't respond to keyboard input.
This isn't even a case of "the second applet". This happens if I start
netscape and go straight to that applet page.
(Note I found I needed to disable jar file caching else plugin would fail
with some regex parsing exeception).
The same tests run fine in appletviewer.
I conclude that even processing is badly broken in this environment.
I am inclined to believe its a plugin-specific problem but all the same I
am sending it first to the AWT team as it may be something in the AWT code that
interacts in some unexpected way with plugin.


  xxxxx@xxxxx   2001-09-28
=============================
I have verified that this problem is no longer reproducible with the latest 6.0 and 7.0 builds, on linux/solaris and windows. So I'm closing this change request as not reproducible.
Posted Date : 2007-04-03 08:14:40.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang