• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

Access denied :\

Hi,

I'm learning Java using JCreator.
I've made some little thing that resolves a hostname.

I get the following error:
java.security.AccessControlException: access denied (java.net.SocketPermission www.reggie.be resolve)

This is the code:

import java.awt.*;
import java.applet.*;
import java.net.InetAddress;
import java.net.UnknownHostException;


public class MSN extends Applet {
     
     public void init() {
          System.out.println("Initializing program ...");
          InetAddress address = null;
          try {
               address = InetAddress.getByName("www.reggie.be");
          } catch(UnknownHostException e) {
               e.printStackTrace();
               return;
          }
          System.out.println("IP:" + address.getHostName());
         
          return;
     }
}

0
Reggie_BE
Asked:
Reggie_BE
2 Solutions
 
CEHJCommented:
You can't create a Socket to anywhere other than the host that loaded the applet unless it's signed
0
 
Reggie_BEAuthor Commented:
ohw, but how c
0
 
Reggie_BEAuthor Commented:
how can I do this then ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
tutranCommented:
For fundamental knowledge about code signing go here:

http://java.sun.com/docs/books/tutorial/security1.2/toolsign/signer.html


Any question, let me know.
0
 
CleanupPingCommented:
Reggie_BE:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
tomboshellCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
SPLIT between CEHJ and orangehead911

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thomas Boshell
EE Cleanup Volunteer
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now