I Have created a Signed applet for web based audio recorder, we are getting the security warning certificate, but the problem is still the applet is throwing the same security exception:
*"java.security.AccessControlException: access denied (javax.sound.sampled.AudioPermission record)".*
Below is the code I am using in the applet
1. TargetDataLine line = null;
2. AudioFormat format = new AudioFormat(8000.0F, 8, 1, true, true);
3. DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
4. line = (TargetDataLine) AudioSystem.getLine(info);
The exception is throwing at line number 5.
The code used for signing the applet is :: creates a keystore database and generates the keys:
I suspect some of the classes on the chain of calls leading to the exception does not originate from the signed jar.
As a rule, all of the classes on the stack must be signed or you must use AccessController.doPrivileged().
Another more tricky way is to execute the code in question on a separate thread (I prefer not).