This discussion is archived
5 Replies Latest reply: Jul 1, 2011 2:16 PM by 793415 RSS

Signed Applet With Multiple Signed JARs Throws Runtime Exception With JNLP

801394 Newbie
Currently Being Moderated
I have a problem where my signed applet throws a runtime exception when the user "denies" the security certificate of a signed applet only when the applet is launched from a JNLP file. I'm wondering if the community also experiences this problem and if there's any workaround or solution. I thought I would converse with the community before filing a bug report on this issue.

Note: I've included a link that has more information and a working example of the applet source code.

Click here for the test case.
  • 1. Re: Signed Applet With Multiple Signed JARs Throws Runtime Exception With JNLP
    EJP Guru
    Currently Being Moderated
    Throws what runtime exception?

    If it is a SecurityException for example this may be correct behaviour.

    Post the exception stack trace here.
  • 2. Re: Signed Applet With Multiple Signed JARs Throws Runtime Exception With JNLP
    801394 Newbie
    Currently Being Moderated
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Client VM
    User home directory = C:\Users\dbladorn
    
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    
    exception: exit(-1).
    ExitException[ 4]java.lang.RuntimeException: exit(-1)
         at com.sun.javaws.Main.systemExit(Unknown Source)
         at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: ExitException[ 4]java.lang.RuntimeException: exit(-1)
  • 3. Re: Signed Applet With Multiple Signed JARs Throws Runtime Exception With JNLP
    EJP Guru
    Currently Being Moderated
    So it exited because the user refused. Seems OK to me.
  • 4. Re: Signed Applet With Multiple Signed JARs Throws Runtime Exception With JNLP
    801394 Newbie
    Currently Being Moderated
    I'm sorry, I missed a very important reason on why I'm attempting to do this in the first place. If the user denies access to the signed applet, I would expect the applet would still run but would only run inside the sandbox. Which would allow the applet to notify the developer or end-user which security manager it's using. But since the applet throws an exception, there's no such mechanism due to the execution of the applet being halted. This kind of puts us in a pinch b/c I can't determine if the applet is actually running as we expect it to from the javascript side.
  • 5. Re: Signed Applet With Multiple Signed JARs Throws Runtime Exception With JNLP
    793415 Pro
    Currently Being Moderated
    RhinoGuy wrote:
    ..If the user denies access to the signed applet, I would expect the applet would still run but would only run inside the sandbox. ..
    So did I! Unfortunately, that is only the default behavior in an Oracle JRE (so far that I have tested). See Does this applet work in an Iced Tea JRE? for the terrible truth that while that is a default behavior in some JREs, it is different in others, & not in any way guaranteed.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points