Ticket #650 (closed defect: fixed)

Opened 14 years ago

Last modified 13 years ago

Reg applet occasionally doesn't work with IcedTea

Reported by: jdreed Owned by: jdreed
Priority: normal Milestone: Upstream Utopia
Component: -- Keywords:
Cc: Fixed in version:
Upstream bug:


See #237:

rbasch wrote:

On my lucid VM, with openjdk-6-jdk 6b18-1.8-0ubuntu1 and icedtea6-plugin 6b18-1.8-0ubuntu1, the Athena registration applet (  http://web.mit.edu/register) is not displayed consistently. It failed to display the first time loaded in my tries, then usually (but not always) was displayed when I reloaded the page. Running firefox in a terminal, I see:

java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
tsetsize: 130
tsetsize: 191
tsetsize: 130
tsetsize: 344
Exception in thread "Thread-7" java.lang.NullPointerException
	at sun.applet.AppletPanel.showAppletStatus(AppletPanel.java:947)
	at sun.applet.AppletPanel.run(AppletPanel.java:607)
	at java.lang.Thread.run(Thread.java:636)
TextBlock: preferredSize called 600 191
TextBlock: preferredSize called 600 40
TextBlock: preferredSize called 600 130
TextBlock: preferredSize called 600 30
TextBlock: preferredSize called 600 344
TextBlock: preferredSize called 600 150
TextBlock: preferredSize called 600 130

The NPE seems to correlate with the applet not appearing.

I saw no problem in a brief test of the Sun JDK.

Change History

comment:1 Changed 14 years ago by jdreed

So, I had a slightly different failure mode: The first time I launched it, I saw the same behavior as Bob where the applet didn't appear. However, when I closed FF to try again, I noticed the applet was in fact underneath Firefox, in a separate window with the title "JavaEmbeddedFrame?". So... yeah.

Subsequent page reloads caused the applet to appear.

My environment is identical to Bob's, with the sole difference that this is running on a physical machine. I really really hope that's not relevant.

comment:2 Changed 14 years ago by jdreed

Interestingly enough, running this with OpenJDK's appletviewer shows transient NPEs that look like the one below. Specifically, it looks like

text.length() is called when text is null.

We should report this upstream (i.e. to moiradev).

About to call parent validate routine
TextBlock: preferredSize called 600 186
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
	at regapplet.TextBlock.paint(TextBlock.java:72)
	at java.awt.Canvas.update(Canvas.java:130)
	at sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
	at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:60)
	at sun.awt.RepaintArea.paint(RepaintArea.java:232)
	at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:709)
	at java.awt.Component.dispatchEventImpl(Component.java:4545)
	at java.awt.Component.dispatchEvent(Component.java:4295)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

comment:3 Changed 13 years ago by jdreed

  • Owner set to jdreed
  • Status changed from new to accepted

I spent some time poking at this tonight. Near as I can tell, it's a race condition between the applet making itself visible -- thus calling paint() -- and the call to setText() in MessagePanel?.java. Setting an initial value for the text should suffice.

The mail is  6022, though discuss mangled my e-mail.

comment:4 Changed 13 years ago by jdreed

  • Status changed from accepted to committed
  • Milestone changed from Natty Alpha to Upstream Utopia

Committed upstream in r4036.

comment:5 Changed 13 years ago by jdreed

This is actually deployed, so people should test the regapplet with IcedTea and/or OpenJDK's appletviewer. Or I'll do it tomorrow.

comment:6 Changed 13 years ago by jdreed

  • Status changed from committed to accepted

Well, that didn't work, I still get the NPE. I don't see how it can possible be null if we set it in the constructor, unless something is setting it to null.

comment:7 Changed 13 years ago by jdreed

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.