1 Reply Latest reply: Apr 8, 2006 10:14 PM by 843844 RSS

    Wat is this error abt??

    843844
      Hi Guys,

      I am awfully new to j2EE and try compiling a very simple code in the book.. but it doesnt seem to work.. may I know why??

      Many thanks!!

      regards
      Henry

      The code giving this error is:
                [i]HelloHome home = (HelloHome)
                javax.rmi.PortableRemoteObject.narrow(
                          ctx.lookup("Hello"), HelloHome.class);


      Error message:
      "Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resources file: java.naming.factory.initial
           at javax.naming.InitialContext.getDefaultInitCtx<InitialContext.java:247>
           at javax.naming.InitialContext.getURLorDefaultInitCtx<InitialContext.java:284>
           at javax.naming.InitialContext.lookup<InitialContext.java:351>
           at HelloClient.main<HelloClient.java:83>"
        • 1. Re: Wat is this error abt??
          843844
          i found the soln..

          just need to include a jndi.properties file with
          "
          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          java.naming.provider.url=localhost

          "

          it works.. =)

          cheers