ConnectionError [client (on VirtualBox) and server (on localhost)] - I use the setting for the host only on the virtual machine

I have a simple C ++ / Java Calc 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 finally did this and installed host-only optinon in VirtualBox using this: https://superuser.com/questions/429405/how-can-i-get-virtualbox-to-run-with-a-hosts- only-adapter themes. Now I have another problem. My client finally sees my server and can even connect to it and send him a message, but he has problems receiving a response from the server: (this time my application is a simple calculation):

 C:\Temp\java>java client -ORBInitRef NameService=corbaloc::192.168.56.1:2809/NameService Choose: 1.Add 2.Sub 3.Mul 4.Div > 3 > Pass number: > 2 > Pass number: > 4 > pač 12, 2012 3:36:58 PM com.sun.corba.se.impl.transport.SocketOrChannelConnectio nImpl <init> WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR _TEXT; hostname: 127.0.0.1; port: 41431" org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(U nknown Source) at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(U nknown Source) at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>( Unknown Source) at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>( Unknown Source) at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.create Connection(Unknown Source) at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.begin Request(Unknown Source) at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(Unknow n Source) at org.omg.CORBA.portable.ObjectImpl._request(Unknown Source) at _CalcStub.mul(_CalcStub.java:64) at client.main(client.java:65) Caused by: java.net.ConnectException: Connection refused: connect at sun.nio.ch.Net.connect0(Native Method) at sun.nio.ch.Net.connect(Unknown Source) at sun.nio.ch.Net.connect(Unknown Source) at sun.nio.ch.SocketChannelImpl.connect(Unknown Source) at java.nio.channels.SocketChannel.open(Unknown Source) at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket (Unknown Source) ... 8 more C:\Temp\java> 

Where 192.168.56.1 is the IP address for the VirtualBox host only. Please help :) In the example here, the response from the server should be 8 (because, as we all know, 2 * 4 = 8;)

OK friends, sorry to bother all of you :) I found the answer: I added these lines to my /etc/network/interfaces file:

 allow-hotplug eth0 iface eth0 inet dhcp 

Cheerz: D

+2
source share

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


All Articles