1 Reply Latest reply on Mar 12, 2002 11:54 PM by Chris Mactaggart

    Cant find org.jnp.interfaces.NamingContextFactory

    Chris Mactaggart Newbie

      Hi

      I have an applet that is a message subscriber.

      If I run it in IE, everything works. But if someone else runs it on there machine, the results vary depending on the jre that they have, some work some dont. The applet also doesnt work on Opera on my machine.

      The error that I am getting is "Cannot instantiate class org.jnp.interfaces.NamingContextFactory".

      The error happens when I create my context

      Hashtable props = new Hashtable();

      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.PROVIDER_URL, "servername:1099");
      props.put("java.naming.rmi.security.manager", "yes");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");

      Context context = new InitialContext(props);

      I have also tried putting these values in the jndi.properties file, but i get the same results.

      I believe that I have put all the files that I need to in my applet archive



      Is there another way to do this?

      Has anybody gotten JMS and applets to work properly together and a wide range of platforms?

        • 1. Re: Cant find org.jnp.interfaces.NamingContextFactory
          Chris Mactaggart Newbie

          After some further digging I found that it is a security issue.
          java.security.AccessControlException: access denied(java.net.SocketPermission http resolve)
          at java.security.AccessControlContext.checkPermission(AccessControlContext.java:188)
          at java.security.AccessController.checkPermission(AccessController.java,
          Compiled Code)
          at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled Code)
          at java.lang.SecurityManager.checkConnect(SecurityManager.java:1012)
          at java.net.InetAddress.getAllByName0(InetAddress.java:556)
          at java.net.InetAddress.getAllByName0(InetAddress.java:537)
          at java.net.InetAddress.getByName(InetAddress.java, Compiled Code)
          at java.net.Socket.(Socket.java:91)
          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:102)
          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:776)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java, Compiled
          Code)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
          at javax.naming.InitialContext.lookup(InitialContext.java:354)
          at ClientApplet.init(ClientApplet.java:46)
          at sun.applet.AppletPanel.run(AppletPanel.java:343)
          at java.lang.Thread.run(Thread.java:472)





          Is there a way around this without the user of the applet having to install something other than updateing the plugin.