| | |
Question about java.lang.SecurityException
![]() |
•
•
Join Date: Nov 2004
Posts: 189
Reputation:
Solved Threads: 0
Hello everyone,
I have written the following simple program to play a local .wav file.
But when running the program, the following exception will be thrown,
Exception in thread "main" java.lang.VerifyError: java.lang.SecurityException: java.applet.AudioClip - protected system package 'java.applet'
at java.lang.Class.verify(Class.java:259)
at java.lang.Class.initialize(Class.java:315)
Does anyone know how to solve the issue?
Thanks in advance,
George
I have written the following simple program to play a local .wav file.
Java Syntax (Toggle Plain Text)
URL url = null; try { url = new URL("file:/c:/temp/sample.wav"); AudioClip clip = Applet.newAudioClip (url); clip.play(); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); }
But when running the program, the following exception will be thrown,
Exception in thread "main" java.lang.VerifyError: java.lang.SecurityException: java.applet.AudioClip - protected system package 'java.applet'
at java.lang.Class.verify(Class.java:259)
at java.lang.Class.initialize(Class.java:315)
Does anyone know how to solve the issue?
Thanks in advance,
George
•
•
Join Date: Nov 2004
Posts: 189
Reputation:
Solved Threads: 0
Thanks jwenting,
I am not writing an Applet, but a Java application. I simply want to use the ability of playing sound of Applet (Interface AudioClip) in my Java application to save my time of writing sound player. So maybe your approach can not work in my situation.
I am wondering whether it is possible to make my Java application be able to use sound playing ability of class Applet?
regards,
George
•
•
•
•
Originally Posted by jwenting
Don't use applet classes outside applets, they won't work outside the applet sandbox.
If this is an applet, remember you can not access ANY resource that doesn't reside on the same server as the one from which the applet main class was loaded.
I am wondering whether it is possible to make my Java application be able to use sound playing ability of class Applet?
regards,
George
![]() |
Similar Threads
- Exception in thread "main" java.lang.noclassdef............ (Java)
- java.lang.NoSuchMethodError (Java)
- Stupid question about java.exe (Java)
- Question about java.lang.UnsatisfiedLinkError in MMAPI (Java)
- Following tutorials and getting java.lang.NoClassDefFoundError (Java)
Other Threads in the Java Forum
- Previous Thread: altering a link
- Next Thread: Looking for J2ME audio or video player
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows






