• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Java bug: Object tag and archive attribute

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that I have found a bug in Java itself, not a browser bug, regarding the Object tag, the 'archive' attribute of the Object tag, and the archive attribute's interaction with Java's internal AppletClassLoader.


I think a little background detail is needed here. Java applets were first embeded into web pages with the APPLET tag and the "archive" attribute on the APPLET tag was a comma-separated list -- this part is important! The replacement for APPLET is supposed to be the Object tag which also has an "archive" attribute but this version of the "archive" attribute takes a space-separated list of values.


So, to the bug, I open the Java Console, trigger logging mode, set trace to level 5, and then open a page with an applet, embeded with the Object tag, using the attribute: (the full version is found below).

This is what appears in the Java Console using Object's version of the archive attribute:
Plugin2ClassLoader.addURL parent called for file:/C:/Desktop/applet/applet/myApplet.class archive1.jar archive2.jar

-- Java thinks it has a single file name: "myApplet.class archive1.jar archive2.jar"

-- Java should have seen three files and cached at least two (the jar files):
1 myApplet.class
2 archive1.jar
3 archive2.jar


Okay, so then, after that, I added a Param tag, formatted using a comma-separated list, just like the APPLET tag uses:

Java's new output:

Plugin2ClassLoader.addURL parent called for file:/C:/Desktop/applet/applet/archive1.jar
Plugin2ClassLoader.addURL parent called for file:/C:/Desktop/applet/applet/archive2.jar


Now it works. Java's applet class loader found the jar files and called them.

So, it appears, that Java's internal class loader is broken -- it only takes a comma-separated list for reading an archive attribute's value. This conflicts with Object's specification of the archive tag which is space-separated. Yet what happens is that Java can't read Object's archive attribute correctly if its longer than 1 item long because Java only reads comma-separated lists of archives.

Run using Java Plug-in 1.6.0_32, that's Java SE 1.6.0_32 release (the current latest version from http://www.java.com).

Just so you know, if you try to recreate this, this is how I sorted my File Locations:
C:\Desktop\applet -- where the html file using the Object tag is located.
C:\Desktop\applet\applet -- where the applet's *.class and .jar files are located.

The full object code (and this was intentionally made verbose for maximum use and browser support) (Note: the code is html 4.01 not xhtml, so remember to close the param tags with slash-bracket "/>" if you copy this code into an xhtml file):

 
Ranch Hand
Posts: 77
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Walter Gabrielsen Iii wrote:..The replacement for APPLET is supposed to be the Object tag ..



Oracle currently supports the Deployment Toolkit Script.
 
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, don't use OBJECT or EMBED. The APPLET tag works fine in my experience, though, but it doesn't handle checking for a particular Java version being installed, and steering the user to download it if necessary.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes using the Applet tag, or the script, does work. So does overloading Object with param values.

I just find it odd that Java can choke up over the difference between a space and a comma. It must be Java's rendering engine that chokes because I'm following its messages through the Java Console in multiple browsers.
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic