Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with an applet that communicates with a JAVA program.

 
Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java program running and it is set to be run on port 2047.
Then I have an applet. Then I put it under the directory to make it accessible through HTTP request (webserver: IIS).
The applet and the java program will communicate with each other in port 2047.

But it gives me some error messages when I try to access it in the web browser:
-----------------------------------------------------------------------------------------------------
Exception in thread "AWT-EventQueue-4" java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:2047 connect,resolve)
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.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
............................
............................
-----------------------------------------------------------------------------------------------------

I'm not sure what I do wrong. Could someone please advise?

Thanks in advance for all the help.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the web server running on localhost as well? Because applets can connect only to the server where they were served from. Try using "localhost" instead of "127.0.0.1", or vice-versa.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic