I have an
applet which fetches bytesstreamed information from the same server it was fetched from (in this case, localhost on port 8080).
It works perfectly with the applet viewer, so I am certain its a permissions problem, plus the Mozilla
java console has this:
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.net.www.protocol.http)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at uk.co.rms.client.store.remote.comms.Comms.communicate(Comms.java:207)
...
I've missed off the rest of the stack trace cos I don't think its relevant and I hate having to scroll paste huge stacks in fora!
Anyway, the line that kicks it all off is this:
conn = (HttpURLConnection) url.openConnection();
and the class that it appears not to be allowed is in package sun.net.www.protocol.http.
The daft thing is that on hitting the problem initially, I added the entire package to the archive ('applet.zip') from which the applet is run, which I would have thought made it perfectly OK.
Can anyone advise why it still doesn't work?
Thanks in advance,
Justin.