When does the RMI Client socket be created?

Hi, I have created my own RMIClientSocketFactory and RMIServerSocketFactory, it was just a normal socket with some print statements. Example:
============================================================
public class MyRMIClientSocketFactory implements
RMIClientSocketFactory, Serializable {
private int hashCode = "MyRMIClientSocketFactory".hashCode();
public Socket createSocket(String host, int port) throws IOException {
System.out.println("creating socket to host : " + host + " on port " + port);
return new Socket(host, port);
public boolean equals(Object object) {
if (object instanceof MyRMIClientSocketFactory)
return true;
return false;
public int hashCode() {
return hashCode;
public class MyRMIServerSocketFactory implements RMIServerSocketFactory, Serializable {
private int hashCode = "MyRMIServerSocketFactory".hashCode();
public ServerSocket createServerSocket(int port) throws IOException {
System.out.println("creating ServerSocket on port " + port);
return new ServerSocket(port);
public boolean equals(Object object) {
if (object instanceof MyRMIServerSocketFactory)
return true;
return false;
public int hashCode() {
return hashCode;
================================================================
I wonder when the message "creating socket on port.." and "creating ServerSocket on port.." will be printed? And I found that the equals() and hashCode() methods are called quite a lot of times when I made one rmi call. When I keep the reference of the remote object for some times, the client socket will be created again. Can somebody tell me how all these work?
Thanks,
Jax

Does it
means that when timeout happened, a new client socket
will be created and make remote calls to renew DGC
leases?Yes.
Again, about exporting remote objects on the same
port, why I got the exceptions:
java.rmi.server.ExportException: Port already in use:
1234;
nested exception is: java.net.BindException: Address
already in use: JVM_BindYou get this if you try to export two servers on the same port but their server socket factories are not equal (or not both null or unspecified), or if the two ojbects are in separate JVMs (port sharing can only work inside a single JVM), or if the port is in use by some other listening process.
Your MyRMIServerSocketFactory.equals() method looks OK to me, but I'd delete the hashCode() method, it's not necessary for RMI and your implementation is flawed. Personally I use the following equals() method:
public boolean equals(Object that) { return that != null && that.getClass() == this.getClass(); }

Similar Messages

  • I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5. I am receiving an error problem when doing the following -  I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive whe

    Hi, I am having a little trouble with exporting images to another drive and Catalogue and need some help if anyone can give me some advice
    I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5.
    I am receiving an error problem when doing the following -
    I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive where a Lightroom Catalogue has been created. In this Catalogue I have arranged for the images once exported to be moved to a different folder - I used the Auto Import process under the File dialogue box.
    When processing the Export I receive an error message for each of the images being exported indicating the following -
    Heading Import Results
    Some import operations were not performed
    Could not move a file to requested location. (1)
    then a description of the image with file name
    Box Save As                                  Box  OK
    If I click the OK button to each image I can then go to the other Catalogue and all images are then transferred to the file as required.
    To click the OK button each time is time consuming, possibly I have missed an action or maybe you can advise an alternative method to save the time in actioning this process.
    Thanks if you can can help out.

    Thank You, but this is a gong show. Why is something that is so important to us all so very, very difficult to do?

  • When does the horizontalScrollBar get created on a List?

    When does the horizontalScrollBar get created on a List?
    The scroller is created, but the scrollbar isn't created yet and I get an error:
    I have a spark List:
    <s:List id="list" creationComplete="creationCompleteHandler(event)">
            <s:layout>
                <s:HorizontalLayout  />
            </s:layout>
    </s:List>
    private function creationCompleteHandler(event:FlexEvent):void {
         (event.currentTarget as List).scroller.addEventListener( FlexEvent.UPDATE_COMPLETE, onScrollerComplete );
    // these don't trigger anything!
    //    (event.currentTarget as List).scroller.addEventListener(FlexEvent.CREATION_COMPLETE , onScrollerComplete );
    //    (event.currentTarget as List).scroller.addEventListener(Event.ADDED_TO_STAGE , onScrollerComplete );
    private function onScrollerComplete(event:Event):void {
         // horizontalScrollBar still null at this point - how can I use it?   
         // I want to set the style, but it's not created yet!
         // event.currentTarget.scroller.horizontalScrollBar.setStyle("repeatInterval", 600);

    I just realized that
    this.setIconImage(new ImageIcon("image.jpg").getImage())
    did not create the icon for my saved files.
    So what did create it? I did not program it!
    However, I happen to have an icon file Ananya.ico where I have my java project. I use if for my installation file. Did Java use this icon?
    Please help! Thanks!

  • When does the actual balance create in gl_balance table?

    Hi,
    I have question on gl_balance table. when does the actual balance create in gl_balance table?
    We are in Oct-11 period and I can see 'E' and 'B' balance data have been created in gl_balance table for future peiord, such as 'Nov-11' .. However, there is no data for 'A' period. Is that right?
    Thank you for your help!
    DeeDee Wu

    Octavio,
    Thank you for your response.
    Do you mean that ‘Actual’ balance for Nov. period will not be in there until Nov. period is opened and have some journals posted?
    Can you help me to understand following data?
    There is one code combination has been closed in 'May' and has Jun period data with last_updated_date = '28-Apr-2010'. Is that Jun data created at 28-Apr-2010 or copied from May data when Jun. period opened?
    CC period LAST_UPDATE_DATE period LAST_UPDATE_DATE period LAST_UPDATE_DATE
    838826 Apr-10 28-APR-10 May-10 28-APR-10 Jun-10 28-APR-10
    Thank you!
    DeeDee Wu

  • When pushing the CCM client, the site information does not appear for hours.

    When pushing the CCM client, the site information takes hours to update.
    Is there a way to force the client and SCCM to talk sooner?
    Bill Z

    Hi,
    You could examine the logfiles(%windir%\ccm\logs) to see if the client is installed successfully.
    ccmsetup.log, client.msi.log,ClientLocation.log, LocationServices.log.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • When does the Java main(String args[]) method exit?

    Hi all,
    I and my colleagues want to know, when does the main() method exit?
    we wrote a small code as follows:
    import java.awt.*;
    public class Test {
    public static void main(String[] args) {
    Frame f = new Frame("hi");
    f.show();
    System.out.println("after show");
    and ran the program, in which case I could see the printed message "after show", but although there is no code after the System.out.println(), the Java virtual machine does not exit and waits for the Frame to close.
    My question is has the main method exited in this case? since it clearly shows that it does not have any more code to execute. Does java create the main method as a thread or as a process?
    regards,
    Harshad

    To make your application terminate you need to add code to cause the AWT thread to handle the termination. In your code, before f.show(), try:
    f.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        dispose();
      public void windowClosed(WindowEvent e) {
        System.exit(0);
    });Now, at least you can click on the little "X" on the upper right-hand corner of the Frame (at least in Win95/98/NT) environments) to cause your application to receive a window closing event. It is also possible to add a menu with an option to exit; in that case I'd use an EventQueue to cause a window closing event to be sent.

  • I was upgrading to iOS5, backed up files on my iphone4, when relaunching the iPhone, I decided to create a new profile (and then copy all contacts from the old profile). The old profile then got erased, together with all contacts. No old profile in iTunes

    I was upgrading my iPhone 4 to iOS 5. The old files in my profile backed up. When relaunching the iPhone, I decided to create new profile on the iPhone, thinking I could copy my old contacts from the old profile (as iCloud seems to merge all contacts). When the ne profile was created on the iPhone, the old profile on iTunes disappared without a trace.  Please help restore my contacts.

    Did you use the Profile Manager or did you use reset to create that new profile?
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems
    A reset tries to import some data from the old profile and then moves the profile to the desktop, but if you use the Profile Manager then you need to copy that data yourself to the new profile.
    If you've deleted the old profile before making sure that your data has been recovered then you've lost that personal data.
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • ABAP Dump is encountered when doing the negative subsequent adjustment

    Hi Experts !!!
    An ABAP Dump is encountered when doing the negative subsequent adjustment (posting a 102 movt type) on a Purchase Order via the Z function module. The dump only happens if the scenario satisfies the following conditions:
    1.Material is either (but may not be limited to) 3000000234, 4000000121, 3000000210 (These are the only reported materials)
    2.Order unit in Purchase Order is in MT
    3.At 2nd weigh, Net Weight is less than PO Order Qty.
    Note: No error occurs if same process is done via MIGO.
    Initial Analysis:
    An exception/error occurs when calling function u201CMB_CREATE_MATERIAL_DOCUMENT_UTu201D .
    Please see below error anlysis report from after executin Zfunction module code.
    Error analysis
       Short text of error message:
       Material 3000000234 / US01 Column 0001: MSEG-BPMNG not in quantity table
       /not consistent
       Long text of error message:
        Diagnosis
            Before the system posts a material document for an HPM/TDP material
            (MARA-CMETH = 1 or 2), it performs the following consistency
            checks:
            o   For each unit of measure in the Unit of Measure Group
                (MARC-UOMGR), a line item  has to be present  in the additional
                quantity appendix table (Table MSEGO2)
            o   For each unit of measure in the main core table MSEG that is
                not initial a line item, has to be present in the additional
                quantity appendix  table (Table MSEGO2) and the corresponding
                packed format quantities have to be identical.
                This way, inconsistent stock level updates can be prevented.
        System Response
            The system stops processing.
        Procedure
            If the error is reproducible, contact your system administrator.
        Procedure for System Administration
            The inconsitency can have several reasons, for example:
            o   Incorrect postings from external systems using function module
                MB_CREATE_GOODS_MOVEMENT
            o   Handling errors
            o   Application programming errors
       Technical information about the message:
    Message class....... "O3"
    Number.............. 359
    Variable 1.......... 3000000234
    Variable 2.......... "US01"
    Variable 3.......... 0001
    Variable 4.......... "BPMNG"
    Please let me know,if you want some other details.

    Problem Issolved

  • WHEN DOES THE IPHONE 5 COMING OUT IN SOUTH KOREA?

    WHEN DOES THE IPHONE 5 COMING OUT IN SOUTH KOREA?

    When it is announced by Apple. No one here would know. Go to Apple.com and watch the press releases to see when it will happen.

  • How and When Does the attribute VI_ATTR_VXI_TRIG_STATUS get initialized

    How and When  Does the attribute VI_ATTR_VXI_TRIG_STATUS get initialized. Do the actual trigger lines get measured or does the attribute get initialized to a default value when the vxi resource manager is executed?

    Hey whl6868,
    According to page 157 (or 3-135) of the manual (http://www.ni.com/pdf/manuals/370132c.pdf), there is no default value for VI_ATTR_VXI_TRIG_STATUS.  If Resman is returning valid values for it, then it must be actually reading the lines.  Else, I would only expect it to return valid values when you actually call the function yourself.
    Regards,
    David R
    Applications Engineer
    National Instruments

  • Move order number when doing the pick release

    hi everyone ,
    is there any way to specify the move order number when doing the pick release process
    i wante to passe the move order number to the pick release API procedure
    or is it possible to change it after doing the pick release
    best regards

    Uses MTL_TXN_REQUEST_HEADERS_S sequence to generate the move order number in, I believe, when-validate-item tirgger.
    Thanks
    Nagamohan

  • HT1657 If I download a movie today, but will not be watching it for a few weeks (i.e. when overseas) - when does the 'activation' period start?  Do I have 48 hours from the download date or when I first watch the movie?

    If I download a movie today, but will not be watching it for a few weeks (i.e. when overseas) - when does the 'activation' period start?  Do I have 48 hours from the download date or when I first watch the movie?

    You have 30 days from when you download it, but when you then start watching it you have 48 hours (24 if your account is US based) to finish watching it before it expires.

  • When does the test time start? After installing the program? Or only after opening the program? background: I accidently installed the Photoshop test version, but O am still busy with testing Premiere Pro.

    when does the test time start? After installing the program? Or only after opening the program? background: I accidently installed the Photoshop test version, but O am still busy with testing Premiere Pro.

    Freialeben7 the evaluation period begins when you first launch the Adobe application you are wishing to evaluate.

  • I just upgraded my data plan from 6GB to 10GB for the same rate of $80 is this a promotion? If yes, when does the promotion end? Thank you.

    I just upgraded my data plan from 6GB to 10GB for the same rate of $80 per month. Is this a promotion? If yes, when does the promotion end?

    In most cases you keep the same plan and promotions even when you upgrade the phone.  There are exceptions for very old plans and unlimited data, but essentially mrhelper is correct. You have option to "keep current plan" when upgrading.  so in most cases, your statement that you will go back to $100 for 10 GB when upgrading is incorrect.  What was your particular circumstance?

  • After downloading the IOS5 my phone gets stuck when doing the back up. What should I do?, After downloading the IOS5 my phone gets stuck when doing the back up. What should I do?

    My iphone gets stuck when doing the back up of the IOS 5. What should I do? Any ideas?

    I'm having the same issue on the 3Gs.  I get a message "an error occurred while backing up this phone (-43)."  It tells me if I continue the contents of the phone while be deleted.  Is it safe to continue and restore from my current backup?  I can do a manual backup without any issues. 

Maybe you are looking for