Re: java.net.URL in applet
Are there any error messages in the browser's java console?
Re: java.net.URL in applet
didnt think about viewing that. it says a lot...
starts with "java.security.AccessControlException: access denied (java.net.SocketPermission 213.21.66.155 resolve)"
Re: java.net.URL in applet
An applet needs permission to connect to any site other than the one it was loaded from.
Re: java.net.URL in applet
thanks, I'm experimenting with "grant". havnt got it to work yet. am I on the right track?
Re: java.net.URL in applet
What is "grant"? Where is it used?
There are a couple of ways to give an applet permission:
sign its jar file
make an entry in the .java.policy file
Re: java.net.URL in applet
the "java.policy.applet" file created by eclipse contains:
grant {
permission java.security.AllPermission;
};
this ought to solve the problem(?) but it doesnt...
however, for those with the same problem, i found a workaround solution.
when you mentioned "An applet needs permission to connect to any site other than the one it was loaded from.", it suddendly truck me.
the apache web server "ServerName" defaults to 127.0.0.1, when it can't determine the IP it it's running from. setting the "ServerName" to the external IP in the apache config file solves the problem!
now, i think I have a dynamic IP, but thats a whole other problem :)
Re: java.net.URL in applet
If you copied and renamed that .policy file to .java.policy and put it the the user.home folder the jvm would use it.
After you put the file there use the policytool program to see if it finds the file.
System.out.println(System.getProperties().getPrope rty("user.home")); // show user.home