File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Reading a .wav file - security error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Reading a .wav file - security error" Watch "Reading a .wav file - security error" New topic
Author

Reading a .wav file - security error

Jody Monahan
Greenhorn

Joined: Feb 10, 2010
Posts: 20
Hi all,

I am trying to upload an applet to a web page. I originally was getting security errors when I accessed the applet from the html page, reasons being that I need to access image files and a .wav file from the applet. I then self-signed the applet for development purposes, however I am still getting security errors when I try and access my .wav file but i am able to access my image files without error? I thought that once the applet was self-signed that you would be given full security rights. Does any-one have any idea why I still cannot access my .wav file?

Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41626
    
  55
What errors are you getting, exactly? And how is the code accessing the two types of files, respectively?


Ping & DNS - my free Android networking tools app
Jody Monahan
Greenhorn

Joined: Feb 10, 2010
Posts: 20
Hi Ulf,

the error I am currently getting is "java.security.AccessControlException: access denied (java.io.FilePermission sample.wav read)".

I have imported a package called jMusic to access my .wav file and used a method from this package to read the file into the program - 'Read.audio("sample.wav");'

I access the image files by setting them to a jLabel, but I do not get the same security errors with these any more since I signed my applet.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41626
    
  55
Make sure the jMusic jar file is signed as well.
Jody Monahan
Greenhorn

Joined: Feb 10, 2010
Posts: 20
Perfect, that works now! Thanks a million Ulf!
 
Consider Paul's rocket mass heater.
 
subject: Reading a .wav file - security error