• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why the rmi server hangs in a particular machine ?

 
Abhinav Anand
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I am facing a strange trouble in one of my software's installations. My software has a rmi server and the server dynamically creates a registry during run time at a port number specified by the user in the following way:
java.rmi.registry.LocateRegistry.createRegistry(port);
Now the problem is that the software is running quite well in 4 place different places. However in one client's installation there is a strange trouble. Actually the trouble is the first time my rmi server is executed it works well but on coming to the above mentioned line it hangs and the whole system seems to freeze. So we press Ctrl + Alt + Del and forcefully terminate the hanged server. Now here the strange thing starts. If again i execute the server for the second time it works normally without any hiccups.
This happens everytime the server is executed the first time after the computer starts up.
I don't understand how the same software can have different behavior in the same circumtance in the same computer.
By the way the configuration of the installation computer is
Windows 98
Celeron Processor
256 Mhz ram.
It also serves as a file and a print server.
Do you guys have any idea as to what is the reason behind this strage behavior ?
Thanks in advance.
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any chance the port they are trying to use is already in use? Have you tried it with a different port?
Any java errors thrown when this occurs?
Chris
 
Abhinav Anand
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Chris,
Negative. The port is free and the problem persists with any other free port. The system simply hangs. No errors are thrown. The system simply hangs without any warning.
Strangely the problem got solved after i defiend a codebase and setup a dedicated class server for stub files. Although the problem is solved, but i don't understand what actually the problem was. Can you explain why using a class server solved the problem for me.
By the way i used the following code as my class server: ftp://ftp.javasoft.com/pub/jdk1.1/rmi/class-server.zip
Thanks in advance,
Vishal
[ January 21, 2004: Message edited by: Vishal Sinha ]
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm well just glancing at the code, it looks like you needed to provide a code base anyways. What is your hardware configuration for the rmi registry to work? I mean were you trying to setup and run the server on on the same machine as your software? Were you trying to make that machine the server and have remote machiens connected to it?
I really have no idea why it might have been a problem. If you actually moved the class server to another machine and your program(server side) started working, it makes me wonder about the class server. Do you have any other servers that provide different functions for people to call in to? If this is the only one, you can probably do without the class server and just start the registry from within your own server side code. There's not much reason to keep an external class server just to direct clients to a single class on a single server. Do you need a class server?
Chris
 
Abhinav Anand
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Chris,
I was trying to make the machine as the server and the other remote machines connected to it through rmi.
In the begining i did'nt provide any sort of codebase and class server concept. It was then that the strange problem i mentioned above arised. However after i provided the codebase and the class server concept the problem got solved. So, not providing the codebase might have been the problem. But what is not clear to me as why the code behaved in such a way as it did in absense of the codebase and class server.
By the way, I am starting the class server from within my code, through the following code:
ClassFileServer cfServer = new ClassFileServer(port, classpath);
So at present the rmiregistry, class server and the remote object hosting everything is being taken care of by my code and all this happens in a single instance of JVM.
As far as the need of a class server is concerned i have observed the following behavior:
I modified the class server to show a message whenever a class file was requested from it. Now when i start rmi registry internally through locateRegistry.createregistry..... code then the rmi mechanism doesn't uses my class server at all. It seems that a class file is requested from the class server by the rmi mehansism only when i start the rmiregistry manually as a separate instance from the terminal.
Please explain this behavior.
Thanks in advance.
[ January 22, 2004: Message edited by: Vishal Sinha ]
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't gone back to look at the ClassFileServer code, but there really is no need for it at all I don't think. If you are starting the registry internally and assigning the classes, there really is nothing left for the class server to do. Thats it. Youve already done it. The registry really IS the true class server. rip out that classserver code and simplify your whole startup...
Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!