Kill rmi server, but Naming.list still works

Hi,
i have built an rmi server program, which creates some remote objects and a program which lists them. However, the program still lists the objects after the server has shudown. Only as soon as i kill the rmiregistry, the listing stops. Why?
import java.rmi.*;
import java.rmi.server.*;
   This server program instantiates two remote objects,
   registers them with the naming service, and waits for
   clients to invoke methods on the remote objects.
public class ProductServer2
   public static void main(String args[])
      try
         System.out.println
            ("Constructing server implementations...");
         ProductImpl p1
            = new ProductImpl("Blackwell Toaster");
         ProductImpl p2
            = new ProductImpl("ZapXpress Microwave Oven");
         System.out.println
            ("Binding server implementations to registry...");
         Naming.rebind("toaster2", p1);
         Naming.rebind("microwave2", p2);
         System.out.println
            ("Waiting for invocations from clients...");
      catch(Exception e)
         e.printStackTrace();
}The following program lists the remote objects:
import java.rmi.*;
import java.rmi.server.*;
public class ShowBindings
     public static void main(String[] args)
          try
               String[] bindings= Naming.list("");
               for (int i=0; i<bindings.length; i++)
                    System.out.println(bindings);               
          catch(Exception e)
               e.printStackTrace();

The RMI Registry holds references to remote objects. Your "list" goes against the Registry, not the remote objects.
The Registry doesn't care what remote objects are alive or dead. That's not it's purpose.
Use unbind() to remove references in the Registry before ending your server.

Similar Messages

  • When I sync with my iphone i get an error reporting message but the sync still works.  After trying to download 10.6.3 Mac OSX Snow Leopard, this message appears every few seconds until I quit Entourage.  How do I turn this message off?.

    Question: 
    When I sync with my iphone I get an error reporting message but the sync still works.  After trying to download 10.6.3 Mac OSX Snow Leopard, this message appears every few seconds as long as Entourage is open.  This continues until I quit Entourage.  How do I turn this message off? It interferes with any other work I am doing.   I appreciate any suggestions.

    I only have one video project that I ever published to iDisk. It didn't have any music or photo files attatched to it, just a few clips stitched together. I can play these clips right now in the Event Library (so I know the source files are on my computer), but strangely, under the Project Library, the project is not there. I'm almost certain that I didn't store the project on iDisk; I just completed the video and published it to iDisk (as a .mov file I think) for family to see. I've tried to figure out how to get iDisk to stop looking for this project to no avail.
    I don't know if others have experienced this, but if I click on any project and on the menu bar select Share --> Remove From --> Media Browser... it lists iPod, iPhone, iPad, tv, Computer and MobileMe. Why would MobileMe be an option here? This is the case for any video project I select. Didn't iLife '11 and/or OSX 10.8 remove all mention of MobileMe? I wonder if this is part of the problem too.
    Edit: I just removed every project I have from the Media Browser. Still no luck.

  • A relative synced my iphone with his laptop without me knowing. It had a passcode on the phone but the sync still worked. I have since found out he is quite IT knowledgeable and has been known to track other peoples phones.  How is this data useful to him

    A relative synced my iphone with his laptop without me knowing. It had a passcode on the phone but the sync still worked. I have since found out he is quite IT knowledgeable and has been known to track other peoples phones that he wants to know information about.  How is my data useful to him and can he restore this data on another iPhone and run it parallel to mine? I have had people send me messages which I have not received. These have been screen shot to me later including time and I have just not got them. I had 4 weeks worth of messages go missing from my phone..I know that he synced my phone because his work laptops I'd came up in my settings. Also if the above can be done can he change the settings on my actual phone and access my location without placing tracking software on my phone.  Can someone please help here as I can't restore a backup to my phone for obvious reasons and refuse to change my number because of this loser.

    Connect the device to the computer.
    In iTunes, select the content desired to sync.
    Sync.
    This is all described in the User's Guide, reading it may be a good place to start.

  • For another program (WASY WGeo) after the working with PS CC I need a picture with the right colours in the end with 256 colours in 8 bit per picture - I still got it until yesterday. I don´t know what I´ve done wrong in PS CC but I´m still working in mod

    For another program (WASY WGeo) after the working with PS CC I need a picture with the right colours in the end with 256 colours in 8 bit per picture - I still got it until yesterday. I don´t know what I´ve done wrong in PS CC but I´m still working in mode with 8 bit RYB. I controlled my result with Irfan View: it´s a picture with 16,7 million colours and 56 bit pp.

    Topic or subject titles should be clear, pertinent and concise so that individual users can tell at a glance if they can help or not.
    That field is not for attempting to fit your entire question in there.
    Please keep this in mind next time you post.  Thank you.

  • No animation or videos will play from Firefox, but other browsers still work fine. I have checked plugins and even updated to the Firefox 14 beta - no fix

    As of yesterday no animation or videos will play from Firefox, but other browsers still work fine. I have checked plugins and even updated to the Firefox 14 beta today, but this did not fix the problem.
    this problem started yesterday; before then there was no problem.
    I have updated everything I can find, and ran a system restore and disc clean.
    The problem still persists. What am I missing here?

    This happened to me too. This problem started suddenly with no changes made on my part. I had 11.2 Flash version with Firefox 13. I tried updating to the new Firefox, same problem, then updated to Flash 11.3. I even uninstalled RealPlayer.
    I read a solution on another forum and it was as easy as clearing my cache. Everything works fine now (even after reinstalling RealPlayer and allowing the download button function).

  • One week ago my iPhone felt, the screen was damaged but it was still working. Today it felt again and now it doesn't turn on, what can I do? Please help me.

    One week ago my iPhone felt, the screen was damaged but it was still working. Today it felt again and now it doesn't turn on, what can I do? Please help me.

    Hold down on the sleep button and the home button at the same time for about 10 seconds until the Apple logo appears on the screen. Ignore the red slider. When the logo appears let go of the buttons.

  • RMI Experts - I cannot connect to server, but connected clients STILL RUN

    I am pulling my hair out, I have 4 identical RMI servers running on RH linux 7.0, JDK1.3. The client is a signed java applet that runs with the JRE1.3 under windows. It binds to each of the 4 servers, and unbinds from the 3 with the most clients connected for load balancing and failover.. The servers are set up as:
    rmi://12.34.56.78:1099/server1
    rmi://12.34.56.78:1098/server2
    rmi://12.34.56.78:1097/server3
    rmi://12.34.56.78:1096/server4
    I am using different ports AND server names, I find that the client confuses things if you don't..
    The problem started when I re-deployed the applet, but it didn't work, so I put the OLD version back out there. NO SERVER SIDE changes at all, and the applet that has been working for months is now the same exact jar file.
    Here's what's happenning: When I look up all 4 servers, 3 are giving me 'No Name Space', even though I'm positive the code is correct. NEW connections are not being allowed, but clients that are ALREADY connected still run perfectly. It's ALWAYS 3 out of 4 servers down, the 4th one NEVER crashes.. When I re-start the server app, it runs for about 3 minutes and crashes again.
    The result is the client only sees one server up and EVERYONE connects to it.. There are about 250 simultaneous connections, and one server cannot handle all this computation..
    PLEASE HELP!
    Doug

    I'm not sure why you care about the connections once
    you have chosen the one you want to keep. You didn't
    say how your servers really know about the number of
    active connections, but if you implement your own
    connect/disconnect on top of RMI, then you should be
    able to keep your connection counts straight.Well, I just assumed that the connections would stay there, but after some testing, it doesn't look like that's the case at all.. In fact, unless you are calling methods, there are NO TCP connections being maintained to the server at all.. 'netstat -a' on the linux server says there is nothing at all when the client app is idle..
    I have a method on the server that gets called by the clients once every couple min's with the user's IP, login, and which app the are using.. The server keep a table of who's logged in (ie, who it's receiving these method calls from), so it konws who's logged in at any given time.. When a user closes the app, this method gets called with some different arguements, then the server removes that entry from the table..
    The server checks it's table every so often and flags a field as 'false' every so often.. The client is responsible for calling this method which changes it back to 'true'. The server checks less frequently than the clients call this method, so if the server checks, and the flag is already false, that means the client app closed and didn't notify the server (ie, power failure, process killed, etc..), so the server has a means of timing out users however frequently you set it up for..
    I have it set up so the client calls the server method every 5 minutes, and the server checks every 10. It works perfectly and there's hardly any overhead at all.. Even with 400 people (which is the highest peak) on the system (across 4 servers), you can't notice a performance decrease at all.. The load is being balanced something like 98 / 102 / 105 / 96, and before this setup it was more like 40 / 153 / 143 / 70.. So it's well worth it..

  • I lost my contacts and mail folders on my exchange server but they are still on my MAC. How can I resync?

    I run both a MAC and a PC with two different mail clients Entourage vs. Outlook. I have never had a problem with the clients syncing with the Exchange server until I did an archive of all emails in outlook that were older than this year. Now some subfolders have disapeared on the PC and the Exchange server but still show up in Entourage. How can I resync Entourage to the Exchange and have Exchange server "accept" the Entourage folders as correct?
    Also I use an Iphone and backup to the icloud. So why did my contacts disapear from the iphone and are not restored via icloud? The missing contacts also disapeared from exchange.
    Iphone 4s ver 5.1.1
    Exchange 2003
    MacBook Pro OSX 10.5.x ( I think - since the finder->about this Mac button doesnt work)
    Entourage 12.3.3
    Thanks so much.
    John

    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622
    You cannot Delete from your Purchase history... But... you can Hide...
    iTunes Store  >   http://support.apple.com/kb/HT4919
    Note:
    iCloud only Stores a Link to your Apps...

  • Note Syncing stopped but contact list is working

    Hello to all,
    First of all, I'm using my iphone for more than one year and before im not using icloud until next year, i sync all of my notes and contact number in icloud. So far its working fine even though my IOS is still 5.x.x. As of now, my contact list is still working and syncing in icloud and i just tried it a minute ago before i make this thread but my notes stopped syncing December 19, 2013 and i don't know what happen! I just notice today because i did save data on my note and i tried to make a backup on icloud but still the new note i created still not appearing on icloud website. I didn't do anything to my iphone and im just curious because my contact list is still working and automatic syncing to my icloud but my note which is also important to me is not syncing anymore. Can someone help me. Thanks in advanced

    You need to sync with software on your computer.  MS Outlook is good, if you have it.  Otherwise, google "contact manager iPhone" and pick one that looks good and fits your budget.

  • Uninstalled Java, but my apps still work??

    I'm wondering if there's something I'm not looking for -- some way Java can start up.
    I uninstalled it and I don't understand why some Java-based apps still work.
    How is that possible?
    The reason I care about this is because I removed Java in response to a virus.
    I haven't found traces of the virus (possibly "Win32/TrojanDownloader.Agent.PDF trojan") anymore.
    I've used all kinds of utils to get rid of it:
    Manually: ProcessExplorer, HiJackThis, Process Scanner
    Automated: NOD32, Malwarebytes, Ad-Aware, Spybot, TrojanHunter, Trojan Remover
    I uninstalled Java with Windows Add/Remove.
    And I don't have any "Java"-titled processes listed as currently running in my Windows Task Manager.
    But now some Java programs work and some say they can't find Java.
    Working: OpenOffice, FileZilla
    Not Working: jEdit, Spark, DirSyncPro
    I just noticed and deleted some "java" titled items in my Prefetch directory.
    I'll restart now.

    Ok, nothing reappeared in the "Prefetch" directory, but OpenOffice and FileZilla both work fine.

  • When i go to gmail it says "Not Found. The requested URL/accounts/service login was not found on this server" but it used to work and I need help getting it to work again.

    I used to go to gmail all the time. Now it says "Not Found" whenever I go to gmail. Is there a reason for this and is there a way I can access gmail again?
    == URL of affected sites ==
    http://gmail.com

    You've been really helpful and I did what you said, but I'm still having a problem. I click on "tools", then click on "Add-ons", and when the box opens I click on "extensions". This is the problem" In the "Add-on" box under "extensions", it says "'''Microsoft.NET Framework Assistant''' 1.0. Adds ClickOnce support and the ability to report installed .NET versions to the web server. '''Not compatible with Firefox 3.6.3.'''" And underneath there are 3 boxes to click on: "options", "enable", and "uninstall". But it won't let me click on any of them. Also, the first thing before the text I just copied, is a red explanation point. This is the only thing that comes up under "Extensions". Any ideas? I'd appreciate any input. Thanks

  • Will baby oil kill macbook pro? It is still working and I do not know if I should do anything orr just pray?

    In a bedroom accident, the wife and I spilled baby oil into my MacBook Pro. (let the jokes begin)
    Amazingly, it still works fine. I know that is a scented mineral oil and that it is not too conductive.
    I took it to our local apple dealer, who said it only has a month to live. While I never thought it would even start, I am now wondering if he was right.
    Would you please address the folowiing questions
    1. Should I do anything? if so, what?
    2. Should I expect it to continue to live?
    3. Is there any REAL danger other than killing the computer?
    I have already backed up data, and am draining tthe oil to the best of myy ability.

    Surprisingly enough, a popular project is for people to make systems completely submerged in mineral oil.  It is a very poor conductor:
    http://www.google.com/search?q=mineral+oil+computer&sugexp=chrome,mod=9&sourceid =chrome&ie=UTF-8
    The problem is that those systems are designed to remain in the oil.  Once you get something like oil on a system that's used in a more traditional sense, you can expect dust and other contaminants to build up quickly.  There's not really much you can do to prevent that.  Over time, that build up can result in cooling or other issues.  If it gets in fans or other moving parts, over time, build up can cause them to fail as well.

  • V4.0.1 suddenly stopped working ("unable to connect to server") while other browsers still work

    Dell Dimension desktop, running Windows XP Pro, sp3; Pentium 4 2.8 GHz; 1 GB RAM; DSL on home LAN.
    Have used Firefox almost exclusively, but it just stopped working today. No new applications installed. Downloaded and reinstalled Firefox to no avail.
    Am able to access all sites using both Safari and Windows Explorer on the same machine.
    When requesting a page, it immediately gives the error:
    "Unable to connect
    Firefox can't establish a connection to the server at..."
    Doesn't take any time to try to connect, to find the server, etc.

    That is an indication that a firewall is blocking the new version of Firefox. For details see [[Firefox cannot load websites but other programs can]].

  • Installed SQL Server but it doesn't work

    I installed SQL Server 2014 but it doesn't work. What should i do now? i have all feathers installed and i can find them in my control panel but i can't find the application on my system, i allowed my firewall to have access on SQL but it doesn't work. I
    need SQL Sever to do my work Can you please help me?
      Aynur Amirfallah

    i find it but it says invalid license but i installed the free one for 180 days
    Hi Aynur,
    Are you getting the following error message when launching SQL Server Management Studio 2014?
    “Invalid license data. Reinstall is required”
    If that is the case, please perform the following steps to resolve the issue. For more details, please review this similar
    thread.
    1. Uninstall Visual Studio 2010 (Isolated) using Add/Remove Programs.
    2. Click on SQL Server 2014 in Add/Remove Programs, then click Uninstall/Change and choose Repair. 
    On the screen where you select the instance to Repair, change the drop down to "Repair shared features only" and complete the wizard.
    However, if you (“I installed SQL Server 2014 but it doesn't work”) refer to other SQL Server issues, please help to post more details here for analysis. We need to know that how you connect to SQL Server, and the full error message you have received. Also
    please show us
    SQL Server 2014 Discovery Report.
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Screen image freezes but iMac seemingly still working

    Hi,
    The screen on my iMAC has started to freeze in the past 1 maybe 2 weeks - there is no pattern to this - seems to be quite random.
    However, it appears that just the image has frozen, the mouse pointer can move over the frozen image but cannot select anything.
    If the iMAC goes into power save whilst the screen is frozen, pressing a key on the keyboard brings the frozen screen image back up - so it seems as though the peripherals are communicating with the iMAC, it's just that the screen image has frozen.
    It froze on me today when doing a manual Time Machine BU to an external HDD - but the BU still continued on and I waited until the ext HDD went into sleep mode which indicates that BU has finished. After a hard reboot, I checked Time Machine and the BU was fine.
    Any ideas on what needs to be fixed here?

    Deleting the two plist files didn't work, and the Disk Utility found no errors with the disk.
    Funny thing is that when I log in as the root user - this doesn't seem to happen, I had the root user up for 4 hours today, not a problem, why? What is it about the root user that seems to be protected from this but all other users are affected after a short period? The only difference is the regularity of login, last time I used root user prior to this problem was last year, have all of the other users picked up the same problem somehow.
    I don't think it's the X1600 graphics card as the screen saver animated image is still able to kick in (or is this a low level BIOS function?), the processor doesn't seem to be frozen either as the talking clock continues to read out the time, the keyboard however does not respond when the screen has frozen.
    Would restoring user accounts from a Time Machine Back up taken before this problem appeared be the way to go? Any potential pitfalls with this - can I literally just restore a user folder or is there other dependent stuff that would have to be restored as well?

Maybe you are looking for