2 Replies Latest reply: Nov 18, 2010 2:06 AM by 814042 RSS

    Signed Applet throwing exception with Selector

    814042
      I have the following code in my applet:
      selector = SelectorProvider.provider().openSelector();
      Which throws the following exception:
      Nov 13, 2010 11:55:40 PM as.App connect
      SEVERE: null
      java.io.IOException: Unable to establish loopback connection
           at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at sun.nio.ch.PipeImpl.<init>(Unknown Source)
           at sun.nio.ch.SelectorProviderImpl.openPipe(Unknown Source)
           at java.nio.channels.Pipe.open(Unknown Source)
           at sun.nio.ch.WindowsSelectorImpl.<init>(Unknown Source)
           at sun.nio.ch.WindowsSelectorProvider.openSelector(Unknown Source)
           at as.network.Network.connect(Network.java:38)
           at as.App.connect(App.java:30)
           at as.PaintApplet.init(PaintApplet.java:42)
           at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      What could be causing the problem? The program works fine if it is run from main(..).

      Test program:
      class A extends Applet {
       public void init() {
        try {
        SelectorProvider.provider().openSelector().close();
        } catch (Throwable e) {
        e.printStackTrace();
        }
       }
      }
      Java info:
      java version "1.6.0_22"
      Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
      Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
      Running windows 7.

      Edited by: 811039 on Nov 14, 2010 12:00 AM