This bug is caused when the Java plugin hasn't had a window registered using PluginMain.registerWindow(), which will set PluginMain.currentWindow.
Without PluginMain.currentWindow set (it is initialised to null), when the gcjwebplugin sends the applet the "width" message, the applet's PluginMain.start() message-reading loop reads the width correctly, but then tries to get the internal height property using: int height = currentWindow.getHeight(); Because currentWindow is NULL it causes the Null Pointer Exception on line 211. The problem is caused in PluginAppletViewer.parse(...). There are several overloaded versions of this function but they all pass through to the work-horse overload that takes a complete set of arguments. In PluginAppletViewer.parse() it scans the HTML APPLET/OBJECT/EMBED tag and extracts the attribute values. When it finds an EMBED tag it passes it to PluginAppletViewer.scanTag(). That method is responsible for scanning the parameters inside the <EMBED> tag and assigning them to internal attributes. When scanTag() returns the EMBED detection-logic does some sanity checks on the attributes to ensure it has what it needs to execute the applet successfully. It checks for the CODE, WIDTH, and HEIGHT attributes not being null. If any one of them is null it sets the attribute reference to null too - effectively wiping them all out. When the logic in PluginAppletViewer.parse() finds the closing tag </EMBED> it checks if the attributes reference IS NOT null and if so calls PluginAppletViewerFactory.createAppletViewer(). That in turn calls PluginMain.registerWindow() which, as I said at the beginning, sets PluginMain.currentWindow. But, because an attribute of the EMBED tag was missing, the attribute reference was null and so PluginMain.registerWindow() wasn't called and PluginMain.currentWindow remained with its initialised value, which is null. Hence the bug. In the case of the sites here the missing tag is CODE, and you can see the warning in the output: Warning: <embed> tag requires code attribute. That really should say "Error" since it is fatal. Because the EMBED tag was not part of a W3C standard the definition of legal parameters is hazy. It has been introduced for HTML 5 *but* will not support the CODE attribute. ** Also affects: openjdk-6 (Ubuntu) Importance: Undecided Status: New ** Changed in: openjdk-6 (Ubuntu) Importance: Undecided => Medium Assignee: (unassigned) => TJ (intuitivenipple) Status: New => Confirmed -- applet fails to load with nullpointerexception https://bugs.launchpad.net/bugs/199732 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs