?
Solved

Access denied :\

Posted on 2003-02-20
8
Medium Priority
?
539 Views
Last Modified: 2008-03-06
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
Comment
Question by:Reggie_BE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 7988348
You can't create a Socket to anywhere other than the host that loaded the applet unless it's signed
0
 

Author Comment

by:Reggie_BE
ID: 7988409
ohw, but how c
0
 

Author Comment

by:Reggie_BE
ID: 7988413
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.

 
LVL 14

Assisted Solution

by:Tommy Braas
Tommy Braas earned 100 total points
ID: 7988593
0
 
LVL 1

Expert Comment

by:tutran
ID: 7990217
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
 

Expert Comment

by:CleanupPing
ID: 9059202
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
 
LVL 7

Expert Comment

by:tomboshell
ID: 9553760
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question