I've wrote a mp3 player and works fine in desktop mode (jar file). But when I try to run it via web an AccessControlException is thrown.
I had the same problem with the buttons graphics, and I solved it by uploading the graphics to an image server. Obviously I don't want to do the same with the songs. I want that any user can play their local songs, using a FileChooser.
¿How can I do this?
.....................................................................................................
More details:
The AccessControlException exception occurs here:
try
{
// f is a File
listaCanciones.getItems().add(f.getName()); //adding filename to a ListView (works fine)
mp3Tmp = new Media(f.toURI().toString()); //creating a Media object
listaReproduccion.add(new MediaPlayer(mp3Tmp)); //creating MediaPlayer object and adding it to a playlist
}
The exception's toString() is:
java.security.AccessControlException: access denied ("java.io.FilePermission" "I:\music\song.mp3" "read")
If you want to access the local filesystem from a jnlp deployed application:
You can find more information in the Java client deployment guide:
-allpermissions
for the javapackager tool).Note: an application which is not deployed via jnlp does not run in a sandbox and does not have the above requirements.
Oracle supply a FAQ for code signing.