1 Reply Latest reply on Sep 21, 2007 8:11 AM by dinesh uikey

    Clients and JBOSS

    rasoul Newbie

      Hello there,
      I have a gui client that runs just fine when executed from the same JVM. However, as a remote client, it gets a :

      javax.naming.NoInitialContextException

      error.

      The error message is:

      Cannot instantiate class: org.jboss.naming.HttpNamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jboss.naming.HttpNamingContextFactory]

      I am at a loss since there is very few resources on this topic and I am new, as you may have guessed by now, to JBoss and EJBs. I thisn I have all the jar files on the client machine, and the getInitialContext function is:

      Properties prop = new Properties();
      prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      //prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
      prop.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
      //prop.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      prop.put(Context.PROVIDER_URL,"lid32.rhythm.com:1091");
      //prop.put(Context.PROVIDER_URL,"http://lid32.rhythm.com:8080/invoker/JNDIFactory");
      return new InitialContext(prop);

      My appologies to those that will be offened by this email being posted twice. SInce I did not get a reply from the beginners forum, I figured I should try my luck w/ this forum.

      Appreciate all the help in advance.

      -r

        • 1. Re: Clients and JBOSS
          dinesh uikey Newbie

          Hai,
          Before running your application set classpath or include in classpath following jar file - %JBOSS_HOME%\client\jbossall-client.jar

          this jar file consist - org.jboss.naming.HttpNamingContextFactory and org.jnp.interfaces.NamingContextFactory classes.

          I'm sure your application must run.