1 Reply Latest reply on Aug 1, 2005 3:53 AM by jaikiran

    javax.naming.NoInitialContextException

    kanthkr

      I did run the example of Stateless session bean provided in Training with Jboss 4.0.2 and Jdk 1.5.
      The server was deployed properly.
      Client is giving the error
      CalculatorRemoteSB
      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 resource file: java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
      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 ClientCalculatorSB.main(ClientCalculatorSB.java:28)

      I am not sure where to mention the location of the jboss server? Please let me know as setting in initial context is not setting the properties.
      Regards,
      SKR

        • 1. Re: javax.naming.NoInitialContextException
          jaikiran

          Place a jndi.properties file in your classpath. The file would typically contain:

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          java.naming.provider.url=jnp://localhost:1099