getting odd security exception in my applet

The error is “Error connecting to server: java.security.AccessControlException: access denied (java.net.SocketPermission [http://www.forgottendusk.cjb.net] resolve)”

The applet is attempting to connect to the main game server on the machine that is hosting the applet. The applet should not need signing.

The odd part about this error is that, currently, it is only happening on Vista and Ubuntu, XP works just fine (I don’t have access to any other platforms for testing).

Is there some reason Ubuntu and Vista won’t allow the connect back to the hosting server?
Is it an issue with dynamic DNS used by the host?
Something else?
OK, looking closer at the error, I see that the hosting page is forgottendusk.cjb.net and the error is for www.forgottendusk.cjb.net… but changing the URL of the applet page to www.forgottendusk.cjb.net doesn’t change the error.

This is really old code that I helped out with when I was learning java many years ago. I am fairly certain it was built targeting 1.3 as a runtime platform.

Any help would be appreciated.

maybe oyu are changing the url in the wrong place. Or it is getting the URL from somewhere you dont notice.

Well, I am typing “http://www.forgottendusk.cjb.net” into the browser and “http://www.forgottendusk.cjb.net” is a parameter passed into the applet. I would think that if I am getting the wrong URL, I would be getting the wrong URL on XP as well.

do you mean int he browser, or in a textbox?

Basically, the host portion of URL of the page serving up the applet exactly matches the host reported in the security exception.
I was under the impression that this exception would be triggered by the applet attempting to contact a host other than the one serving up the applet. If the applet was attempting to contact a different host, I would also assume that XP would get the exception as well.

I cant really help you, I dont know much about networking. I jsut figured I give you my two cence.

GL


new Socket("www.forgottendusk.cjb.net", 80);

How about that?

One thing that struck me:

should be:

As you cannot resolve “http://…etc…” as a hostname

Maybe you’re calling:
new Socket(“http://www.forgottendusk.cjb.net”, 80);
?

If all fails, you’re probably running Firefox and making your initial connection off the EDT. (I know that sounds far fetched, but it is a bug.) The Java plugin has quite a few bugs in Firefox, that cause the AccessControlException. Search these forums a bit. In older versions (like 1.6.0_u07) I ran into this issue. Under certain circumstances, you get the above exception, if you just create a new thread and connect. If you make your initial connection inside Applet.{init|start}() all future connections from any thread will work just fine. It smells like a race-condition, but I cannot reproduce it since u11.

I was getting this same error for no apparent reason, then I remembered that I changed the code for the socket connection. I had to look at some other stuff I programmed to find out why it was working there and not here and I found it

this didnt work for me, I still got the socket permission error


servName = "http://www.mightyrealms.com";
ccSock = new Socket(servName,pNum);

this fixed the error for me


//this.getCodeBase().getHost() //must use this or u get socket.permission error
ccSock = new Socket(this.getCodeBase().getHost(),pNum);

Hopefully this helps!

This was it, changed the argument to the applet to not include the http:// and the problem went away.
Odd that XP should behave differently.

Many thanks.