How to connect the client (on VirtualBox) and the server (on the local host)? I am using CORBA and C ++ / Java

I have a "Hello world" C++/Java application with CORBA . The server is written in C++ , the client in Java . I use omniORBs omniNames as a name service.

I would like to run my omniNames and server on my localhost (Ubuntu) and run my client on Windows XP SP3 in VirtualBox installed on my localhost Ubuntu.

(I mean: I installed Ubuntu OS on my local host, and on Ubuntu I installed VirtuaBox with Windows XP SP3 "inside."

I tried this:

  • I ran omniNames on my Ubuntu localhost ,: omniNames -start
  • I started my server, also on the same computer, the local host with the Ubuntu OS: ./server -ORBInitRef NameService=corbaloc::localhost:2809/NameService
  • I checked the localhosts IP address on the website: http://whatismyipaddress.com/ and wrote it down, which was, for example: xxxx
  • On Windows XP, a client is running on VirtualBox: java client -ORBInitRef NameService=corbaloc::xxxx:2809/NameService

but got errors:

 C:\Temp\java>java client -ORBInitRef NameService=corbaloc:212.106.19.209:2809/Na meService pač 10, 2012 3:51:17 PM com.sun.corba.se.impl.naming.namingutil.CorbalocURL badA ddress WARNING: "IOP00110603: (BAD_PARAM) Bad host address in -ORBInitDef" org.omg.CORBA.BAD_PARAM: vmcid: SUN minor code: 603 completed: No at com.sun.corba.se.impl.logging.NamingSystemException.insBadAddress(Unk nown Source) at com.sun.corba.se.impl.logging.NamingSystemException.insBadAddress(Unk nown Source) at com.sun.corba.se.impl.naming.namingutil.CorbalocURL.badAddress(Unknow n Source) at com.sun.corba.se.impl.naming.namingutil.CorbalocURL.<init>(Unknown So urce) at com.sun.corba.se.impl.naming.namingutil.INSURLHandler.parseURL(Unknow n Source) at com.sun.corba.se.impl.resolver.INSURLOperationImpl.operate(Unknown So urce) at com.sun.corba.se.impl.resolver.ORBInitRefResolverImpl.resolve(Unknown Source) at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(Unknown Source) at client.main(client.java:28) C:\Temp\java> 

Is such a connection to the client and server possible? How can I do it? I only have client files in Windows XP - nothing else - no names, no server files, just a client program.

+4
source share
1 answer

I checked the localhosts IP address on the website: http://whatismyipaddress.com/ and wrote it down, for example: xxxx

This is unlikely to be the correct IP address to use. How to configure a network for a virtual virtual machine? If you use the default network, then the guest cannot talk to the host, so instead you need to configure the network "only for the host" and then use the IP address of the host of this network (which you should be able to find using ifconfig on the Ubuntu host, look for the vboxnet interface), telling the client where to find the ORB. You may also find that you need to add firewall rules on the host machine to allow incoming connections in the virtual interface.

Please note that you can have more than one network interface configured for the same virtual machine, therefore, if the virtual machine needs access to the Internet, as well as to ORB, then it is quite normal to configure it using two interfaces, one NAT and another host only.

+7
source

Source: https://habr.com/ru/post/1438917/


All Articles