2 Replies Latest reply on May 24, 2005 4:00 AM by Darran Lofthouse

    InitialContext.lookup(" ") problem

    Mateusz Waglik Newbie

      Hello I have a problem

      I write a client :

      public class Proba {

      private static final String JNDI_NAME = "ModelEJB";

      public static void main(String[] args) throws NamingException {

      //JNDI properties
      Properties h = new Properties();
      h.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      h.put(Context.PROVIDER_URL,"t3://localhost:1099");

      InitialContext ctx = new InitialContext(h);
      Object obj = ctx.lookup("ModelEJB");
      }
      }

      and I recive an error :

      javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1159)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1239)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:527)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at Proba.main(Proba.java:25)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      Caused by: java.net.SocketTimeoutException: Receive timed out
      at java.net.PlainDatagramSocketImpl.receive(Native Method)
      at java.net.DatagramSocket.receive(DatagramSocket.java:711)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1129)
      ... 10 more
      Exception in thread "main

      Do You have any ideas whats wrong?
      thx
      Waglik