RE: [jade-develop] NotYetConnectedException

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

A little bit more information. I've quoted a previous message below
to provide context. I hope that someone who is familiar with the Classpath
NIO code can at least suggest some avenue for further debugging.

After equipping VMChannel.java and SocketChannelImpl.java with some
debug output, I see the following. This occurs after running for several
hours.

VMCHANNEL.GETPEERADDRESS RETURNS NULL BECAUSE NFD.ISVALID => FALSE
SOCKETCHANNELIMPL.ISCONNECTED: RETURN FALSE DUE TO REMOTE == NULL
DUMP OUT STACK TRACE FOR THROWABLE T =
java.nio.channels.NotYetConnectedException
java.nio.channels.NotYetConnectedException
   at gnu.java.nio.SocketChannelImpl.write(SocketChannelImpl.java:266)
   at
gnu.java.net.PlainSocketImpl$SocketOutputStream.write(PlainSocketImpl.java:668)
   at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:109)
   at java.io.FilterOutputStream.close(FilterOutputStream.java:84)
   at jade.mtp.http.KeepAlive$KAConnection.close(KeepAlive.java:125)
   at jade.mtp.http.KeepAlive$KAConnection.send(KeepAlive.java:160)
   at jade.mtp.http.KeepAlive.send(KeepAlive.java:298)
   at
jade.mtp.http.MessageTransportProtocol.deliver(MessageTransportProtocol.java:325)
   at
jade.core.messaging.RoutingTable$OutViaMTP.route(RoutingTable.java:109)
   at
jade.core.messaging.MessagingService$ServiceComponent.routeOut(MessagingService.java:1112)
   at
jade.core.messaging.MessagingService$ServiceComponent.access$2800(MessagingService.java:1002)
   at
jade.core.messaging.MessagingService.forwardMessage(MessagingService.java:1364)
   at
jade.core.messaging.MessagingService.deliverNow(MessagingService.java:1188)
   at
jade.core.messaging.MessageManager$Deliverer.run(MessageManager.java:152)
   at java.lang.Thread.run(Thread.java:743)
Sep 28, 2007 12:39:36 AM <unknown> <unknown>

WARNING: MessageManager cannot deliver message (INFORM sender: (
agent-identifier :name df@xxxxxxxxxxxx:1099/JADE  :addresses (sequence
http://192.168.0.27:7778/acc )) ontology: FIPA-Agent-Management
conversation-id: conv-FOO@xxxxxxxxxxxx:1099/JADE1190961596406-54) to agent
FOO@xxxxxxxxxxxx:1099/JADE. java.nio.channels.NotYetConnectedException

The immediate problem is that the instance variable VMChannel.State.valid
is false when VMChannel.write is called. Either it was never true, or it was
true and then changed to false. Reading through VMChannel.java and its 
associated native code, gnu_java_nio_VMChannel.c, I don't see how "valid"
is maintained.

Any comments about this problem are much appreciated.

Robert Dodier

PS. Context:


Robert Dodier wrote:
> 
> Quoting Caire Giovanni <giovanni.caire@xxxxxxxxxxxxxxxx>:
> 
>> This is quite surprising and honestly speaking I've never seen this
>> exception. Can you provide more details about your environment (JVM, JADE
>> or
>> JADE-LEAP, containers and hosts, split execution?...) and the situation
>> where
>> it happens?
> 
> I am running JADE-LEAP 3.5 on JamVM 1.4.5 + Classpath 0.95 + Linux 2.6.21
>  + Xscale cpu (an ARM-architecture cpu) on the hosts which encounter
> the NotYetConnectedException. These hosts are trying to send messages
> to PC's which are running JADE-LEAP 3.5 + Sun JVM 1.5.0 + Linux
> 2.6.something
>  + i686 cpu. On every host there is an ordinary container (no split
> containers).
> 
> The exceptions seem to be thrown only after an ARM host has
> been running for a while (maybe 1 hour to several hours).
> Restarting the JVM seems to make the problem go away.
> I say "seem" because it's not clear to me what are the
> circumstances in which the exceptions are thrown.
> 
> Probing into the Classpath source code, it appears that the
> NotYetConnectedException originates from gnu.java.nio.SocketChannelImpl.
> (The exception is never thrown from JADE, to the best of my
> knowledge; grepping for NotYetConnectedException in the JADE
> source code turns up nothing.) In SocketChannelImpl,
> the exception is thrown if the method isConnected returns false.
> Here is the definition of isConnected:
> 
>   public boolean isConnected()
>   {
>     // Wait until finishConnect is called before transitioning to
>     // connected.
>     if (connectionPending)
>       return false;
>     try
>       {
>         InetSocketAddress remote = channel.getPeerAddress();
>         return remote != null;
>       }
>     catch (IOException ioe)
>       {
>         ioe.printStackTrace(System.out);
>         return false;
>       }
>   }
> 
> I do not know whether the false return value comes from
> the "return false" or "return remote != null".
> I guess I'll keep digging. If anyone has any comments
> about this I would appreciate it a lot.
> 
> All the best & thanks for your help,
> 
> Robert Dodier
> 
> 

-- 
View this message in context: http://www.nabble.com/RE%3A--jade-develop--NotYetConnectedException-tf4477830.html#a12983314
Sent from the Gnu - Classpath - General mailing list archive at Nabble.com.



[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux