Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot connect to VM

I made a test class in my android project to check if my database works. But when I want to debug this class it gives me an error: "Cannot connect to VM", in details it says also "Socket operation on nonsocket: configureBlocking". When I try debugging a test class in another project it works and debugging my other classes in the android project also works. Can the problem be that I try to run a normal test on an android project?

Can someone help me? Thanks!

like image 806
Kat Avatar asked Dec 04 '11 10:12

Kat


People also ask

Can't connect to VM server?

Shut down your virtual machine. In Workstation, go to VM > Settings > Network Adapter. Ensure that the network adapter is connected (that is, the Connected and Connect at power on options are selected). Ensure that the network adapter is configured for NAT or Bridged, and not Host-Only.

How do I connect to my VM?

Connect to the virtual machineSelect the virtual machine from the list. At the beginning of the virtual machine page, select Connect. On the Connect to virtual machine page, select RDP, and then select the appropriate IP address and Port number. In most cases, the default IP address and port should be used.

How do I fix failed to connect to remote VM Connection refused Connection refused connect?

Just restart the Java application in debug mode. One of the human error which causes "Failed to connect to remote VM. Connection refused". Some time typo on hostname or port causes Eclipse trying to connect different servers or a different port, which is an obvious reason you get this error.


2 Answers

You probably figured this out already, but for others who get stuck in this situation, here is my answer. I've had this problem a couple of times myself now, and I finally found out that it's related to

including a "main" method in your android class files: Don't do it!

Run Configuration in Eclipse: Delete the automatically created application configurations

The following link provides a very good explanation about the problem, the solution, and the reasons: http://independentlyemployed.co.uk/2010/11/16/solved-internal-error-classfileparser-cpp3161/

like image 77
Rune Avatar answered Oct 30 '22 01:10

Rune


It caused by having a "main" method.
Delete/rename the method and then go to the properties of the project.
Click "Run/Debug Settings" and delete the class (it may make eclipse to run the class after being compiled).

like image 35
YulCheney Avatar answered Oct 29 '22 23:10

YulCheney