This site requires JavaScript, please enable it in your browser!
Greenfoot back
jagrosh
jagrosh wrote ...

2013/5/3

java.security.AccessControlException: access denied ("java.net.SocketPermission" "www.cool-midi.com:80" "connect,resolve")

jagrosh jagrosh

2013/5/3

#
I'm currently working on this (Midi Animation ) scenario, which is meant to animate midi files from a user-given url. It works fine when the original scenario is run on a computer or the .jar file is run, but it doesn't work on the Greenfoot site and I figured out that it was giving the following error: java.security.AccessControlException: access denied ("java.net.SocketPermission" "www.cool-midi.com:80" "connect,resolve") Does anyone know a way to fix this? The line that causes this error is:
song = MidiSystem.getSequence(new URL(name));
...where song is a Sequence and name is the full URL of a .mid file.
jagrosh jagrosh

2013/5/4

#
Is anyone knowledgeable about java Applet permissions?
bourne bourne

2013/5/4

#
URL might be causing it. Why don't you include the file with the upload so that you can access it locally
jagrosh jagrosh

2013/5/4

#
bourne wrote...
URL might be causing it. Why don't you include the file with the upload so that you can access it locally
Yes the URL is the problem. However, I cannot include the file because there is no single file; the point of the program is that it can play ANY .mid file on the web. So what I need to do is figure out a way for the applet to gain permission to access the web.
iau iau

2013/5/5

#
For an applet to get permission to access any URL on the Web (which is what you need), you will need to "sign" your applet's jar file before uploading it to the Gallery. This is not simple, and may well cost real money. Applet signing is described in many places, including here and here. If you want other users to run your scenario, you'll need to buy a "code signing certificate" that their browsers trust.
You need to login to post a reply.