1 Reply Latest reply on Feb 8, 2007 11:27 PM by jaikiran pai

    javax.naming.NoInitialContextException:

    deepali bhosale Newbie

      Hi my ejb application is deployed on the Jboss server.
      18:19:37,945 INFO [EjbModule] Deploying BookBean
      18:19:38,242 INFO [EJBDeployer] Deployed: file:/C:/JBOSS/jboss-4.0.2/jboss-4.0.2/server/default/deploy/book.jar

      when i m trying to invoke the client by
      C:\Books\src>java -classpath %LIBDIR%\jnp-client.jar;%LIBDIR%\jboss-common-client.jar;%LIBDIR%\jboss-j2ee.jar;%LIBDIR%\j
      boss-net-client.jar;%LIBDIR%\jbossall-client.jar;;%LIBDIR%\jnet.jar;C:Books; BookClient

      it gives following error:
      javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet pa
      rameter, or in an application resource file: java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at BookClient.main(BookClient.java:20)


      also when i just say javac BookClient then i et following error:
      javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed
      out]
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1302)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1382)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at BookClient.main(BookClient.java:20)
      Caused by: java.net.SocketTimeoutException: Receive timed out
      at java.net.PlainDatagramSocketImpl.receive0(Native Method)
      at java.net.PlainDatagramSocketImpl.receive(Unknown Source)
      at java.net.DatagramSocket.receive(Unknown Source)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1272)
      ... 5 more

      my jndi.prperties file is in c:/books directory . this path is in classpath.
      whats the problem?

      Deepali