access denied (java.net.SocketPermission

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jan Meyer

    access denied (java.net.SocketPermission

    When I run the code below as an applet I get this message:
    Hello java

    there was a problem

    access denied (java.net.Socke tPermission yahoo.com resolve)

    But when I take the same code for reading the url as an application it
    works.

    What do I need to do???

    ............
    import java.net.*;
    import java.io.*;

    import java.applet.App let;
    import java.awt.Graphi cs;

    public class HelloWorld extends Applet {
    public void paint(Graphics g) {
    g.drawString("H ello world!", 50, 25);
    System.out.prin tln("hello java");


    try{

    URL url = new URL("http://yahoo.com");
    URLConnection connection = url.openConnect ion();

    PrintWriter out = new PrintWriter(
    connection.getO utputStream());
    out.println("st ring=stringToRe verse");
    out.close();

    BufferedReader in = new BufferedReader(
    new InputStreamRead er(
    connection.getI nputStream()));
    String inputLine;

    while ((inputLine = in.readLine()) != null)
    System.out.prin tln(inputLine);

    in.close();

    }
    catch ( Exception e)
    {
    System.out.prin tln("there was a problem");
    System.out.prin tln(e.getMessag e());
    }


    }
    }
    ...............

  • Maj0r

    #2
    Re: access denied (java.net.Socke tPermission

    You have to sign your applet.

    Comment

    • Jan Meyer

      #3
      Re: access denied (java.net.Socke tPermission

      Maj0r wrote:[color=blue]
      > You have to sign your applet.[/color]

      How do you do that?

      Do you have any urls that explain that?

      thanks.

      Comment

      Working...