InetAddress.getLocalHost() in an applet sometimes throws AppletSecurityException

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P3
    • None
    • Affects Version/s: 1.1
    • Component/s: core-libs
    • sparc
    • solaris_2.5.1



      Name: mc57594 Date: 03/11/97


      Source code:

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

      public class test extends Applet {
        InetAddress addr;

        public void init() {
          try {
            addr=InetAddress.getLocalHost();
            System.out.println("Local Host Address = "+addr);
          }
          catch (Exception e) {
            e.printStackTrace();
          }
        }

        public void paint(Graphics g) {
          g.drawString("Local Host Address = "+addr,10,10);
        }

      }

      I have tried running this code under appletviewer on 3 boxes I've
      got around. On the one configured with NetraJ S/W Solaris 2.5.1,
      it works fine. On the other 2 which have standard Solaris 2.5.1
      and Solaris 2.5 (this one is ENS supported) installed, it
      always throws the AppletSecurityException.

      Since rmi also calls InetAddress.getLocalHost(), it will also
      not work under the same circumstances (that's how I got to
      write this small test applet). I've been trying changing
      things like /etc/nsswitch.conf but without success.
      company - SMCC (Thailand) , email - ###@###.###
      ======================================================================

            Assignee:
            Benjamin Renaud (Inactive)
            Reporter:
            Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: