[RMI] Naming.lookup freezes

From: Richard Körber (shred_at_despammed.com)
Date: 06/30/04


Date: Wed, 30 Jun 2004 10:20:48 +0200

Hi!

I am stuck with an issue with RMI and rmiregistry. Everything is working
fine all day long. But when I keep the computer with the rmiregistry
("Server") running 24/7, and then try to connect to it next day, my
client freezes at Naming.lookup():

"main" prio=1 tid=0x080528c0 nid=0xc83 runnable [feffc000..feffd5c8]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
         - locked <0x59b16728> (a java.io.BufferedInputStream)
         at java.io.DataInputStream.readByte(DataInputStream.java:331)
         at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java: 189)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
         at sun.rmi.transport.DGCImpl_Stub.dirty(Unknown Source)
         at
sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.jav a:328)
         at
sun.rmi.transport.DGCClient$EndpointEntry.registerRefs(DGCClient.java :275)
         at sun.rmi.transport.DGCClient.registerRefs(DGCClient.java:112)
         at
sun.rmi.transport.ConnectionInputStream.registerRefs(ConnectionInputS
tream.java:80)
         at
sun.rmi.transport.StreamRemoteCall.releaseInputStream(StreamRemoteCal
l.java:134)
         at
sun.rmi.transport.StreamRemoteCall.done(StreamRemoteCall.java:284)
         at sun.rmi.server.UnicastRef.done(UnicastRef.java:422)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Naming.java:84)
         at test.Remote.reconnect(Unknown Source)
         at test.Remote.<init>(Unknown Source)
         at test.RMITest.main(Unknown Source)

The rmiregistry port responses to a telnet connection, though, so the
registry seems to be up and running. The server application is running
as well, at least I get periodical log messages from one of my threads.

I need to restart the rmiregistry and the server application, in order
to get it work for another day. That's not quite what I am expecting. ;)

Anybody has any idea why Naming.lookup() freezes?

I am using Sun's J2SE (build 1.4.2_04-b05) for Linux, both on client and
server.

Thanks in advance!

Regards

-- 
:// Richard "Shred" Körber -~- shred@despammed.com -~-


Relevant Pages

  • Re: RMI & connection refused
    ... the client machine, telnet to port 1099 on the server machine. ... The Naming.listcall to the rmiregistry returns the list of registered RMI ...
    (comp.lang.java.programmer)
  • Re: Why do you need an HTTP server at all in RMI ?
    ... >:In general you need an HTTP server in RMI to get some java code moved ... you'll see that "rmiregistry" is expected to be run with NO ... first have to retrieve a stub reference to it from the rmiregistry. ...
    (comp.lang.java.programmer)
  • Re: Unable to bind class to RMI registry
    ... I was starting rmiregistry in one terminal window, while launching the ... When launching the server I used a -classpath ...
    (comp.lang.java.programmer)
  • Re: Connecting Web site to Application
    ... Your applets have to be signed however. ... However, in the latter case, users will get an security warning. ... On the server you should run the rmiregistry and your ... You should run rmiregistry on the server. ...
    (comp.lang.java.programmer)
  • Re: How to get RMI to work - stub issues
    ... test.jar is a package with client. ... It's a while since I worked on RMI and rmiregistry, but I think you need to add ... University of Leicester, Leicester, LE1 7RH, UK ...
    (comp.lang.java.programmer)