Bug 912

Summary: IcedTea-web 1.5+ bf80f38923af RuntimeException: Multiple main JARs specified, refusing to continue.
Product: Default Reporter: Xerxes Rånby <xerxes>
Component: defaultAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: ---    
Version: unspecified   
Hardware: All   
OS: all   
Type: --- SCM Refs:
Workaround: ---

Description Xerxes Rånby 2013-11-26 09:55:46 CET
On Mon Nov 25 10:16:42 2013 IcedTea-web added the following change-set:
http://icedtea.classpath.org/hg/icedtea-web/rev/bf80f38923af
This change cause all the jogl-test-applets to trigger an icedtea-web runtime exception:
"Multiple main JARs specified, refusing to continue."

# requires compilation of icedtea-web 1.5+ hg):
hg clone http://icedtea.classpath.org/hg/icedtea-web
cd icedtea-web
./configure --with-jre-home=/usr/lib/jvm/java-7-openjdk-i386/jre
make install
# the icedtea-web plugin gets installed into /usr/local/lib/IcedTeaPlugin.so
# place a symlink to the IcedTeaPlugin.so plugin into /usr/lib/mozilla/plugins
# or ~/.mozilla/plugins

http://jogamp.org/deployment/archive/master/gluegen_751-joal_502-jogl_1161-jocl_882-signed/jogl-applet-version.html

Output:

netx: Initialization Error: Could not initialize applet. (Multiple main JARs specified, refusing to continue.)
netx: Initialization Error: Could not initialize applet. (Multiple main JARs specified, refusing to continue.)
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet. For more information click "more information button".
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:720)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:650)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:878)
Caused by: java.lang.RuntimeException: Multiple main JARs specified, refusing to continue.
	at net.sourceforge.jnlp.ResourcesDesc.getMainJAR(ResourcesDesc.java:82)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.checkForAttributeInJars(JNLPClassLoader.java:789)
	at net.sourceforge.jnlp.JNLPFile$ManifestsAttributes.getAttribute(JNLPFile.java:940)
	at net.sourceforge.jnlp.JNLPFile$ManifestsAttributes.getAttribute(JNLPFile.java:929)
	at net.sourceforge.jnlp.JNLPFile$ManifestsAttributes.getApplicationName(JNLPFile.java:908)
	at net.sourceforge.jnlp.JNLPFile.getTitleFromManifest(JNLPFile.java:343)
	at net.sourceforge.jnlp.PluginBridge.getTitle(PluginBridge.java:236)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.waitForJars(JNLPClassLoader.java:1394)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:647)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:258)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.createInstance(JNLPClassLoader.java:379)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:441)
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:417)
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:686)
	... 2 more
Comment 1 Xerxes Rånby 2013-11-26 10:05:28 CET
The discussion for this icedtea-web change is to be found here: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-November/025336.html
Comment 2 Xerxes Rånby 2013-11-26 12:52:41 CET
Assigned to IcedTea Web

#OpenJDK irc.oftc.net 26 Nov 2013

(10:11:47) xranby: jvanek: good morning.. tested the latest icedtea-web 1.5+ hg tip and all jogl applets broke https://jogamp.org/bugzilla/show_bug.cgi?id=912
(10:12:42) jvanek: xranby, hello!
(10:12:57) xranby: it would be good to know what we do wrong in our jnlp or object tags to trigger this odd exception
(10:13:09) jvanek: xranby, hm, I was digging recently in multiple main jars appelts specified
(10:14:15) xranby: jvanek: we have several applets and all of them now trigger this multiple main jars http://jogamp.org/deployment/archive/master/gluegen_751-joal_502-jogl_1161-jocl_882-signed/jogl-test-applets.html
(10:14:35) jvanek: xranby,  What is done in 1.5, is , that  when more them one "main" attribute is specified, or when more then one jar have main-class specified in manifest, itw will stop work
(10:15:32) xranby: for applets main is specified by the jnlp or the object tag no?
(10:15:53) jvanek: yes
(10:16:05) jvanek: but jnlp can have (by mistake) more "main" specified
(10:16:19) jvanek: and if no main is specified, we are scaning individual maifest
(10:16:50) jvanek: so where we were ok in 1.4, we stopped now
(10:16:53) xranby: we use the object tag and use the code=" parameter to specify main
(10:17:00) jvanek: that should work
(10:17:13) xranby: and we opnly specify one main as fair as i am aware
(10:17:21) jvanek: fair enough
(10:17:27) jvanek: I need to check yur :testcases"
(10:17:34) jvanek: s/:/"
(10:17:36) xranby: http://jogamp.org/deployment/archive/master/gluegen_751-joal_502-jogl_1161-jocl_882-signed/jogl-applet-version-napplet.html
(10:18:06) xranby: this is one of our simplest applets
(10:19:09) xranby: the only reason i can see for this to go wrong is if the parser picks up the main from inside the comment tag

(10:53:04) jvanek: xranby,  ok, foir now aded here: http://icedtea.classpath.org/wiki/IcedTea-Web-Tests#IcedTea-Web_plugin_test_sites: but I'm already hunting it
(10:53:27) jvanek: the link above are cases we really run manually quite often....

(11:39:47) xranby: so the culpit is ff fails to handle <object> with nested <param  tags correctly... ?
(11:39:49) xranby: hmm
(11:40:20) xranby: let me retry that jogl applet using chromium to cross check
(11:40:27) jvanek: xranby, nn
(11:40:33) jvanek: for jogl it is clear itw bug
(11:40:46) jvanek: (maybe we recieve the params, but we should hande it correctly

(11:46:26) jvanek: xranby, just fdor curiosity, is <comment> specified somewhere?
(11:47:16) xranby: jvanek: http://docs.oracle.com/javase/7/docs/technotes/guides/plugin/developer_guide/using_tags.html#object
(11:47:42) jvanek: xranby, I see, thanx :-/
(11:47:48) jvanek: yup we ignore it....
(11:48:05) jvanek: I mean, we dont ignre the content of it :")
(11:48:12) jvanek: just now it flowed up
(11:48:25) xranby: ok great.. problem understood

(12:18:12) xranby: jvanek: so if i understand it correctly the icedtea-web parser somehow adds one main from the <object <param name="code" value="   and another main from <embed code=" at the same time
(12:18:25) jvanek: I'm still on it
(12:18:32) jvanek: but it stinks :)
(12:18:56) xranby: jvanek: are you working on a bugreport as well or should i add one ?
(12:19:06) jvanek: I'm working on fix...
Comment 3 Xerxes Rånby 2013-11-26 14:30:46 CET
http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-November/025360.html - [rfc][icedtea-web] removed recent check for multiple main jar
Comment 4 Xerxes Rånby 2013-11-27 14:32:52 CET
Fixed by icedtea-web in 1.5+ d5bcc8f80d90 :
http://icedtea.classpath.org/hg/icedtea-web/rev/d5bcc8f80d90 - Reverted "fix to ManifestedJar1Test cases", better manifestedjar tests, added srtict test