0

I have an applet which is doing some sound recording work. When I run it on eclipse with Applet viewer , the sound recording and its play back is working fine. But when I put that applet in browser, all the buttons and controls are visible but the recording and play back is not working. Any reasons for that?

I have signed the jar but still it is not working. I verified my jar from jarsigner. It messages

jar is unsigned (Signature missing or unparsable)

What does this message means actually?

Update

The Jar is now signed and verified (as per comments), new exception is:

   java.lang.SecurityException: trusted loader attempted to load sandboxed resource    from file:/D:/Junaid/workspace/AudioProjectApplet/bin/com/audio/
   at com.sun.deploy.security.CPCallbackHandler$ParentCallback.check(Unknown Source)
   at com.sun.deploy.security.CPCallbackHandler$ParentCallback.access$1500(Unknown Source)
   at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.checkResource(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Community
  • 1
  • 1
Muhammad Salman Farooq
  • 1,325
  • 9
  • 26
  • 54
  • Assalamu-Alikum :) Try to put `JOptionPane.showMessageDialog`s in the two buttons to identify where is the bug. Try to show us some code also :) –  Oct 19 '12 at 08:29
  • 1
    I think this is security issue. Did you sign your applet? – stemm Oct 19 '12 at 08:33
  • *"Any reasons for that ? "* Short of an URL to the applet, code etc. I would predict `AccessControlException` for 'the web page that listens back'. – Andrew Thompson Oct 19 '12 at 09:59
  • @stemm I have signed the jar but still it is not working. It should prompt for requesting computer resources but it is not prompting – Muhammad Salman Farooq Oct 19 '12 at 12:08
  • Sorry, I verified my jar from jarsigner. It messages "jar is unsigned (Signature missing or unparsable)" What does this message means actually? – Muhammad Salman Farooq Oct 19 '12 at 12:30
  • 1
    @AndrewThompson I have signed the jar correctly. Now it is giving me the java.lang.SecurityException. I dont understand why, as i have signed the jar and also varified it by jarsigner -verify command – Muhammad Salman Farooq Oct 20 '12 at 06:40
  • @AndrewThompson yes I have seen the security prompt. First it prompts like "Block potentially unsafe components from being run ?" with yes or no buttons. I press yes button. Then a prompt open saying "java.lang.SecurityException: trusted loader attempted to load sandboxed resource from file". – Muhammad Salman Farooq Oct 20 '12 at 06:50
  • I think you are referring to a different security prompt. One produced by Chrome or IE. For the ***actual Java security prompt***, see [this example with screenshots](http://stackoverflow.com/q/12986333/418556). – Andrew Thompson Oct 20 '12 at 07:32
  • @AndrewThompson yes I have the prompt produced by IE , the 1st one in your screen shot example link. But when I click on Run, then I get the java.lang.SecurityException : trusted loader attempted to load sandboxed resource from file. I can place the stack trace if it is necessary. – Muhammad Salman Farooq Oct 20 '12 at 07:48
  • Now I look more closely at that latest exception, I am not so sure my earlier comment about 'caching' was correct. Copy the entire stack trace and edit it into the question. AFAIU from that message, the trusted code is attempting to load loose classes from the server. – Andrew Thompson Oct 20 '12 at 07:49
  • `from file:/D:/Junaid/workspace/AudioProjectApplet/bin/com/audio/` What is the structure of the directories containing the HTML and the Jar? What HTML is used to load the applet? Does the path `D:/Junaid/workspace/AudioProjectApplet/bin/com/audio/` actually exist? – Andrew Thompson Oct 20 '12 at 08:13

1 Answers1

1

sorry i dint get it correct last time. Typically, verification of signed JAR files will be the responsibility of your Java™ Runtime Environment. Your browser will verify signed applets that it downloads. Signed applications invoked with the -jar option of the interpreter will be verified by the runtime environment.

However, you can verify signed JAR files yourself by using the Jarsigner tool. You might want to do this, for example, to test a signed JAR file that you've prepared.

The basic command to use for verifying a signed JAR file is:

jarsigner -verify jar-file This command will verify the JAR file's signature and ensure that the files in the archive haven't changed since it was signed. You'll see the following message if the verification is successful:

jar verified. If you try to verify an unsigned JAR file, the following message results:

jar is unsigned. (signatures missing or not parsable) If the verification fails, an appropriate message is displayed. For example, if the contents of a JAR file have changed since the JAR file was signed, a message similar to the following will result if you try to verify the file:

jarsigner: java.lang.SecurityException: invalid SHA1 signature file digest for test/classes/Manifest.class