aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Help Needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Help Needed" Watch "RMI Help Needed" New topic
Author

RMI Help Needed

Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
Hi Folks,
I have implemented the Server in RMI. I wanted to know why i keep getting am error message "No such Object in Table"

In my server cocstructor i create a serviceImpl instance which is bound to the registry. Later i get the instance of the server using RMI but when i call any method on that stub i get this error.

Also i return a POJO from one of the methods of the service interface. However, it is not bound to the registry. Please can you tell me if i need to bind all the objects that are returned by the methods of the service interface?
TIA,


-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Chulwoo Choi
Ranch Hand

Joined: Apr 11, 2005
Posts: 65
Hi Folks,
I have implemented the Server in RMI. I wanted to know why i keep getting am error message "No such Object in Table"

In my server cocstructor i create a serviceImpl instance which is bound to the registry. Later i get the instance of the server using RMI but when i call any method on that stub i get this error.

Also i return a POJO from one of the methods of the service interface. However, it is not bound to the registry. Please can you tell me if i need to bind all the objects that are returned by the methods of the service interface?
TIA,

The implementation class of RMI interface (serviceImpl) is the only one to be bound. And that's what you did...
  • Do you use Java 5? If not, did you generate stub class using rmic? (Note the stub class is required even if you use Java 5.)
  • Does your value object implement Serializable?


  • Chulwoo
    Sam Codean
    Ranch Hand

    Joined: Feb 26, 2006
    Posts: 194
    Thanks Chulwoo,
    Some more details. I created the interface and its implementation. Then generated the relevant stubs using rmic and packaged three jar files.
    Client - Having the code related to GUI
    Common - Service interface and some other interfaces alongwith the stubs. Please note that i send the server a Task (interface) and get back a Result (Interface). The implementation of Result and Task is kept on the server.
    Do i need to generate the stubs for these too? I think not. There are methods in my service interface itself that will allow me to get their handles createTask returns Task instance, performTask which returns Result instance

    Server - Where the data class and RMI implementations are kept. I place the Client and common on my laptop and server and common on my pc. I tried to run both client and server on my local machine and it worked fine but i still am not able to run that in my small network. I use java 5.0 and i have set the dynamic downloading off. As per my understanding that should not be the problem (sun itself wants that). I have all the rmic generated stubs in place so no downloading should occur

    Please help!!!
    Chulwoo Choi
    Ranch Hand

    Joined: Apr 11, 2005
    Posts: 65
    ....
    Then generated the relevant stubs using rmic and packaged three jar files.
    ...

    Did you have 3 jar files?
    Shouldn't we have one jar file (runme.jar) and execute it in three different ways (to run server, local client, or networked client)?

    (Your submission would be another jar that include runme.jar, source codes, docs, etc.)

    Chulwoo
    Sam Codean
    Ranch Hand

    Joined: Feb 26, 2006
    Posts: 194
    I have not created the final jar as yet. This is for my testing purpose only.
    Meanwhile i wrote sample classes with similar intrefaces and found that the registry is releasing the object bound to it very soon. That is why i am getting that No object in table method.
    I set the lease period to 10 minutes but still i am not able to hold that object in there
    if you have any hints then it would be helpful
     
    wood burning stoves
     
    subject: RMI Help Needed