How to start rmi on a computer with 2 network cards ?

I would like to write a programm to get system informations from any linux computer connected to a network. A RMI server installed on each network computer measures the informations and send them to a RMI Client based on a central computer, where the information is stored on database.
Each computer is identified by its IP address. This is why the IP adress is sent with the string of system informations. For instance, the information sent for a CPU measure is :
<Computer>
<AddIP>192.168.1.1</AddIP>
<CPU><Frequency>500</Frequency><Brand>Intel</Brand></CPU>
</Computer>
In the case when a computer has two IP adresses : 192.168.1.1 and 192.168.2.64, if the computer is reached by 192.168.1.1 it should return the following string :
<Computer>
<AddIP>192.168.1.1</AddIP>
<CPU><Frequency>500</Frequency><Brand>Intel</Brand></CPU>
</Computer>
and if reached by 192.168.2.64 :
<Computer>
<AddIP>192.168.2.64</AddIP>
<CPU><Frequency>500</Frequency><Brand>Intel</Brand></CPU>
</Computer>
The string does not contains all IP adresses but these from which the computer was asked for a measurement. Here is the code for the RMI server :
public class ServeurAgent {
public ServeurAgent() {
try {
// we launched a RMI service for each IP address :
LocateRegistry.createRegistry(portRMIAgent);
// the 192.168.1.1 parameter for AgentImpl is only
     // used to generate the XML String
Agent agent1 = new AgentImpl(192.168.1.1);
Naming.rebind("rmi://192.168.1.1:1099/serviceRMI",agent);
Agent agent2 = new AgentImpl(192.168.2.64);
Naming.rebind("rmi://192.168.2.64:1099/serviceRMI",agent);
catch (Exception e) {
System.out.println("echec du lancement des Agents : "+e);
public static void main(String args[]) {
new ServeurAgent();
We hoped that when the RMI client asked for a measurement on one IP address we could get in the XML String the same IP address, but the problem is that whatever the IP adress is asked, the XML String always contains the same IP address. For example if we ask for a measurement on the 192.168.2.64 adress we have got :
<Computer>
<AddIP>192.168.1.1</AddIP>
<CPU><Frequency>500</Frequency><Brand>Intel</Brand></CPU>
</Computer>
instead of :
<Computer>
<AddIP>192.168.2.64</AddIP>
<CPU><Frequency>500</Frequency><Brand>Intel</Brand></CPU>
</Computer>
Do you have any idea of what could be the problem ? Is the code correctly written ?
Here is the code for the RMI client :
public void mesurer(ipAdress) {
try {
valeur_mesures = "";
          Agent agent = (Agent) Naming.lookup("rmi://"+ ipAdress +":1099/serviceRMI");
          // valeur_mesures is the XML string
          valeur_mesures = agent.getCPUs();
catch (MalformedURLException murle) {
System.out.println();
System.out.println("MalformedURLException");
System.out.println(murle);
catch (RemoteException re) {
System.out.println();
System.out.println("RemoteException");
System.out.println(re);
} catch (NotBoundException nbe) {
System.out.println();
System.out.println("NotBoundException");
System.out.println(nbe);
Thank you for your help.

You may have solved it by now but your code is using the wrong variables when binding objects:
Agent agent1 = new AgentImpl(192.168.1.1);
Naming.rebind("rmi://192.168.1.1:1099/serviceRMI",agent);
Agent agent2 = new AgentImpl(192.168.2.64);
Naming.rebind("rmi://192.168.2.64:1099/serviceRMI",agent);
Notice you are creating agents "agent1" and "agent2" but you are storing the stub of an instance called "agent".
Otherwise, it should work so long as the names you are binding the variables to are unique and not rebound anywhere else.

Similar Messages

  • How do i use a new computer with my ipod?

    how do i use a new computer with my ipod?

    See this apple support communities user tip…
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • How activate media encoder in my computer with creative cloud

    How activate media encoder in my computer with creative cloud

    Log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    or
    Online Chat Now button near the bottom for Activation and Deactivation problems may help
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html

  • How do I use my third computer with cloud. I am rendering a project in Avid Media composer

    How do I get my third computer to work with when I am rendering Avid project on the other two computers computers

    Hi,
    Running creative cloud on third machine will prompt you for the deactivation from last 2 machines. As per EULA for Creative cloud you can only install and work on 2 machines only, be it MAC-MAC, MAC-windows and windows-windows.
    working on third machine without deactivation from previous machines is not possible.
    Hope this helps.
    Thanks
    Kapil Malik

  • HT5622 How can I authorize a new computer (with windows 8) without deauthorizing my other computers (windows 7) . Under manage your account the only choice given is to deauthorize all computers already authorized

    I just bought a new computer with windows 8. I have 2 other computers (windows 7) authorized for itunes. When I go to manage your account the only choice I am give is to deauthorize all computers. There is no place from which to authorize this new computer or to deauthorize the 1 computer that is dead rather than both. Suggestions appreciated

    To authorize the Windows 8 computer, press the Alt and S keys and choose Authorize this Computer, or click here, follow the instructions, click on Store in the menu bar, and choose Authorize this Computer.
    It isn't possible to individually deauthorize a computer which is dead or which you don't have either physical or network access to.
    (87970)

  • How to install All-In-One software with network printer?

    I plugged my 7310xi into my Linksys WRT54G router. In Windows 7 64-bit I found the printer, installed the default drivers, and it's printing happily via the network.
    But I need to install the HP All-In-One software if I want more advanced functions like scanning to my computer. 
    Downloaded the software from the web. During installation I get to the part where it asks me to choose how the printer connects to the computer. I select "through the network," click next,and it just keeps on kicking me back to this screen and I can't proceed. Any ideas?
    Here's the error:
    Now Launching=X:\hpzdui40.exe -I XXX -f X:\DIVins??.DAT
    fail to load library X:\hpzscb01.dll
    CNetworkUIPlugInApp::InitInstance fail to initialize sacabod. Result = o;
    GetLastError = 193
    RUN: Driver UI Plug-In exits returning 50
    Exit code=50
    I've set it to run in Vista compatibility mode and Run as Admin.
    Message Edited by fuzzybabybunny on 08-06-2009 11:59 AM

    I had exactly the same problem with Windows 7 64-bit and HP Photosmart 2610xi. All you need to do is right click on the installation program, go to properties, go to compatibility mode, select Windows Vista SP2 and optionally check run as administrator. It worked after that.

  • PCI USB2 Controller card conflicts with network card

    I've installed a PCI USB2 controller card since my motherboard (IWill K266-R) only has support for USB1. However, the card seems to conflict with one of my network cards, because traffic on the internet-connected NIC is very slow, and often drops completely. Traffic to and from the other (local) NIC seems to work fine, though.
    I have tried moving around all three cards in different PCI slots, I think I've tested almost every possible combination by now. I've also tried disabling as much as possible in BIOS, such as onboard sound, serial and parallel ports etc. I've tried lowering the FSB.
    For now, I've removed the controller card, and is using the USB1 ports on the motherboard instead. This is very frustrating, though.
    Does anyone have any suggestion on what I can try next? I've browsed forums, both this and others, but I haven't found any more hints on what to try. Could there be some setting in Arch that could affect these sorts of things?

    "I guess the ATA100 card will work fine correct?"
    If you mean large drive support, it may provide that or may require a firmware update to do so. You should check the manufacturer's web site for specifics. All ATA-133 cards do provide 48-bit LBA for large drive support. I'd return the Ultra ATA-66 card to the eBay seller, although many refuse to pay for return shipping, even when the mistake is their own, either through ignorance or deliberate misrepresentation. In cases such as this, it's sometimes more cost-effective to swallow the loss and keep the incorrect part.
    "Will adding a jumper apply for a ATA100 card as well? I'll need a blue and gray ribbon correct?"
    If you use an 80-conductor ribbon cable with color-keyed connectors, set the drive configuration jumper to CS and connect the drives to the cable as you wish (in terms of physical placement in the computer). If the ribbon cable doesn't have color-keyed connectors, set the jumper for the device connected to the end connector as Master and the drive (if any) connected to the middle connector as Slave.

  • Solaris9 x86 problem with network cards, ACPI, IRQs

    Hello!
    For the last two days I've been trying to solve the problem of Solaris9 x86 not being able to use my network card. I have tried with 3c905CX-TX-M, RealTek 8139 and Realtek 8029 and none of them works. The problem is the following:
    Everything is properly configured, networking etc., but the cards can only send and cannot receive packets. When trying to ping, the packets leave the NIC but none of the reponses are detected by NIC. When I check with 'kstat elxl' I can see that 'intr' is zero, and out_packets is increasing as it's sending packets.
    From the discussion forum I can see that this same problem has been known for several years. One of the conclusions is that Solaris x86 sucks at dealing with IRQ setup and that the best thing is to disable ACPI and 'PnP OS' option in BIOS. However, I've tried all releases of AMI bios and none them has neither of those options. I have played with various priority levels in BIOS but all that has accomplished is that the card, when first started, captures a few interrupts/packets but then stops again. This is usually just enough to finish the ARP exchange (arp -a shows the remote host).
    And of course, all the cards work just fine in WindowsXP and Linux. And all the cards work nice in another PC which runs the same Solaris 9 x86.
    My motherboard is Gigabyte 7VTXE. (The other one in which it works is ASUS P2B-DS).
    I would really appreciate help!
    Josip

    I had almost identical problem today on an HP Kayak - which happened to be dual CPU one. The fix
    set pcplusmp:apic_forceload = -1
    in /etc/system worked for me. The only drawback is that it also leaves the machine single CPU. AFAIK this (downloadable) S9x86 kit is licensed only for one CPU anyway, so I wonder if something has been fixed in the code to make sure it is not run on multi-CPU systems. Before the fix, mpstat showed thousands of interrupts on CPU0, both CPUs were constantly busy at about 70% and there was no network connection on a number of cards I tried (3Com 90x - elxl, Intel iprb, another one with Realtek 8139 was never recognized, so I did not bother too much to find if there is a fix for this); pinging out resulted in the hub port light blinking, nothing comes back.
    Anyway, the fix is good enough to test s9 for now; everything else seemed to be OK. If it may be of some use for somebody, don't go into the disk option of the Solaris Management Console; the machine in question had Windows 2003 server (RC2) installed before Solaris9, the disk tool decided that there was no label on the disk and asked to write it on; I clicked the 'cancel' button, but the partition table was irreversibly damaged, so I had to start from installing W2k3. My guess is that tool has been tested only with Sparc, so there is no issue with BIOS level partitioning there. BTW, system info of the SMC insists that the CPUs are Sparcs...

  • Want to check local wifi hotspots with network card

    I've been told that my new MacBook Pro comes with a wireless network card and that I can use it to check whether there are wifi networks around.  Is there a way find out info on local networks with my Mac?

    Well, it's not technically a card, it's built in, but it's easy.  First go to System Preferences (it's under your Apple Menu, top right corner), then click on Network.  Along the right side is an icon that says "Airport".  Click on that.  Then check off "Show AirPort status in menu bar".  On your menu bar, then you should see something that looks like a signal (which shows strength).  If you click on that, you will see all the hotspots near you.

  • How to start RMI Server Jar on server?

    Im using RMI, I have two jar files. One Server Jar which contains rmi server, registry start code and all methods which performs action on database .
    I put this jar file on tomcat web-apps directory.
    Another jar is containing User Interface code, which runs on client side.
    for performing any action server jar needs to be run all the time and RMI Registry always needs to be started so that client can communicate with database.
    How can i execute this server jar from client ?

    You can't execute the server from the client. The question doesn't begin to make sense. The server has to be already running for the client to have anything to connect to. You have to organise something at the server side to start it. And putting JAR files into the web apps directory doesn't accomplish that. You could write a Servlet or a listener that starts the RMI server when it's initialised, and stops it when destroyed. If you have to run it inside Tomcat at all, which isn't necessarily a good idea.

  • How do I call a Mac computer with Face Time from my iPhone 4?

    I just upgraded my iMac to OS X Lion and I now have Face Time on my desktop computer. I figured out how to MAKE a call from my desktop to someone's iPhone. But, I can't figure out how to call my desktop computer FROM my iPhone 4? I tapped the phone icon. Then, selected my house from my contact list. When I selected my home e-mail address, it just loaded a blank e-mail. There was no option to call that e-mail address with Face Time. Help? Oh, and I'm running iOS 4.2.10 on my Verizon iPhone 4, so I know I have the required version on my phone.
    Any helpful tips would be greatly appreciated!
    Thanks!

    Oh, and by the way, I also just tried calling my iPhone 4 from my iMac with Face Time and my iPhone didn't even ring. Also, I've read through posts in other forums and everyone is talking about a Face Time camera icon that appears next to a contact's name. I don't have that at all. So, maybe I don't actually have the right versions of the software?

  • How to share music on same computer with different accounts

    Hi -
    I just got a new IMAC and me and my girlfriend use it and have two different accounts on the computer. I am trying to figure out how she can listen to my music from my itunes account when she is logged into her account. I seem to be failing at the suggested home sharing options that apple reccomends? is there a way? does she need to import all my songs into her account and recreate her own playlists that way?
    thanks for any and all help
    j

    Ok, so the iTunes music folder holds all the music. I copy or drag my iTunes folder and my Daughters iTunes folder from our separate user accounts to the shared music folder. Then open iTunes and steer my and my Daughters iTunes Music folder location to the same place.
    If she downloads new music I would have to open iTunes under my user account. Go file/add folder to library/ locate the new music on the shared music folder and that would bring something into my library file so I could see the new music on my iTunes.
    I guess what I started out to do was save memory space on my computer. Does all this do that?
    If it doesn’t I really don’t care anymore as long as I can copy her new music to my iTunes and vise versa.
    Thanks for the help
    Mainer

  • How to start WAD report from MSS with Hierarchy ?

    Hello to all.
    I have a WAD Report that the parameters for it are: Org  unit - as the root, and a year/month.
    The report receive an org unit and display data for it and for all org units under it in the Org. structure.
    I start the report from the MSS.
    In R/3 in table T77MWBBWS I created an entry for that report with Reference char. = "ORG_STRU" instead of "0orgunit".
    The report ignores the Org unit that I choose from the MSS selection screen, and starts with the Root Org unit of my Org structure.
    What to do in order to start the report with the Org unit that i select and to get results for all the org. units under it ?
    Thanks, Pazit Atar.

    I am also facing same problem.
    I want to know how the org unit which is selected on MSS screen is passed to backend R/3 report (which is using PNP logical db)
    PLEASE HELP.

  • How to start career in Cloud Computing?

    Please suggest me career path for cloud computing. I have experience in Application packaging and virtualization app-v 4.6. Apart from it I have experience in applications deployement using SCCM 2012.
    Firoz Ahmad

    Hi there. You should get control of the Cloud OS vision, if you want this career to be the Microsoft way. 
    MVA got great jump-start courses so that you can learn more about the cloud offerings from Microsoft, such as Windows Server with Hyper-V, System Center, Windows Azure and Windows Azure
    Pack.
    -kn
    Kristian (Virtualization and some coffee: http://kristiannese.blogspot.com )

  • How do I use a new computer with same old iPod?

    Before I knew about the problem of switching computers I purchased some new songs from iTunes on my new computer, but using my old login. It allowed me to purchase and upload the songs to my new computer, but it won't let me put them onto the iPod.(?!#@) In retrospect, I suppose I should've created a new iTunes user account for the new computer, but since I didn't, does anyone know how I can get these songs onto my iPod? Or am I just out the 25 bucks?
    Going forward, should I create a new user account for my new computer? If so, how do I do that? I just want to be able to purchase and upload songs and transfer them to the iPod. There must be a way. Thanks for any tips/advice.

    I figured it out. I just needed to "authorize" my new computer.

Maybe you are looking for