2 Replies Latest reply on Nov 22, 2002 1:10 AM by garyg

    CommunicationException: Peek timed out.

    garyg

      Any ideas why I'd be getting the following errors from my remote client?

      --- my log files
      [ERROR]: Could not get JNDI context
      [ERROR]: Could not get JNDI context
      [ERROR]: NamingException javax.naming.CommunicationException: Peek timed out [Root exception is java.io.InterruptedIOException: Peek timed out]

      --- console output
      javax.naming.CommunicationException: Peek timed out. Root exception is java.io.InterruptedIOException: Peek timed out
      at java.net.PlainDatagramSocketImpl.peek(Native Method)
      at java.net.DatagramSocket.receive(DatagramSocket.java:349)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:930)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1017)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:447)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
      at javax.naming.InitialContext.lookup(InitialContext.java:345)
      at com.neuroquest.cais.clients.fielder.Fielder.createPTP(Unknown Source)
      at com.neuroquest.cais.clients.Fielder.Fielder.main(Unknown Source)

      --- my ~/conf/jndi.properties which is in the classpath

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://192.168.0.10:1099/
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      #jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory
      #jnp.timeout=0
      #jnp.sotimeout=0

      Any help much appreciated.

        • 1. Re: CommunicationException: Peek timed out.
          garyg

          Just some more info if anyone has any ideas ... It was suggested by Scott that I do the telnet command below. I did and saw all this so the naming server is there ...

          $ telnet 192.168.0.10 1099
          Trying 192.168.0.10...
          Connected to 192.168.0.10.
          Escape character is '^]'.
          ¬í ♣sr ↓java.rmi.MarshalledObject|½▲-ícü>☻ ♥I ♦hash[locBytest ☻[B[objBytesq ~ ☺x
          p§4Y↔ur ☻[B¬ó↨oTà☻ xp %¬í ♣t ¶http://banshee:8083/q ~ q ~ uq ~ ♥ A¬í ♣sr
          org.jnp.server.NamingServer_Stub &#9787;&#9787; xr &#8594;java.rmi.server.RemoteStubé_ÜÉ<áe
          &#8594;&#9787; xr &#8735;java.rmi.server.RemoteObjectOa'`&#9792;a3&#9650;&#9829; xpw7 &#9794;UnicastRef2 &#9792;172.17.66.55U

          Any other ideas much appreciated.

          • 2. Re: CommunicationException: Peek timed out.
            garyg

            And here's the code that I'm trying to connect to the server with (which destroys a queue if already registered, and then recreates it, for those cases where the client may go down) ...

            // this is the jboss server I'm connecting to remotly
            String adaptorName = "jmx:" + props.getProperty("fielder.manager") + ":rmi";

            try {
            InitialContext ctx = new InitialContext();
            RMIAdaptor adaptor = (RMIAdaptor) ctx.lookup(adaptorName);
            ObjectName name = new ObjectName("jboss.mq:service=DestinationManager");
            RemoteMBeanServer server = new RMIConnectorImpl(adaptor);
            ObjectName queName = new ObjectName("queue/myQueue");

            boolean registered = server.isRegistered(queName);

            String[] sig = {"java.lang.String"};
            Object[] arg = {props.getProperty("myQueue")};

            if (registered) {
            log.info(Fielder.class, "already registered, destroying queue");
            server.invoke(name, "destroyQueue", arg, sig);
            }

            log.info(Fielder.class, "creating queue");
            server.invoke(name, "createQueue", arg, sig);
            ...