Cannot connect to VM in Eclipse - java

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
I have suddenly begun getting this weird error when I try to debug any of my projects on Eclipse. I don't remember changing anything for this problem to start so suddenly.
'Launching <my program name>' has encountered a problem.
Cannot connect to VM.
Details of the error:
Cannot connect to VM
com.sun.jdi.connect.TransportTimeoutException
Further, in the console I get the following error:
FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection timed out
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
[../../../src/share/back/debugInit.c:750]
Please tell me how to solve this problem. I have searched the whole web for an answer but to no luck.
I tried the following solutions which worked for other people:
Restarted Eclipse, restarted computer.
Change hosts file in etc\ - Remove the comments (#) sign before 2 lines namely,
127.0.0.1 localhost
::1 localhost
and restarted.
Turned off all firewalls, restarted Eclipse and retried. Still no luck.
Somebody please help me, I'm going crazy.
Thanks
Sousa

I just found this: Avast! 2014 I have it, and so it fits. If you do as well, then that is probably your problem.

I am using Mac and I ran into similar issue. I made the changes to /etc/hosts file earlier, which I have reverted now to make it as below :-
127.0.0.1 localhost
And restarted the system and fixed my issue.

After much stress and a lot of time, the problem is now resolved. Albeit in a very freaky way which does not amuse me as I can't figure out the rationale behind it. Anyways, here is what happened and maybe someone can throw some more light on what could have been the root cause of the problem.
I uninstalled Eclipse and Java completely from my system.
I then re-installed the latest version of Java (I had this same version previously too).
But this time I installed it in the standard directory and not the custom directory that I was using before (Probably something here was wrong the first time).
I then re-installed Eclipse (latest version again).
And just like that, it all started working normally again, Debug mode and everything!
What immediately comes to my mind is that the system environment variables could have got changed somehow. But I don't understand how this could have happened without me touching anything.

I think the problem is because you have set the wrong path to jre .try right click on your project and click run configuration and set jre correct path. Could you please elaborate more about the issue.

I ran into the same problem. It turned out that I have changed my /etc/hosts file where the ip address 127.0.1.1 was commented out. After uncommented it, it started to work again.

disable windows firewall and it's OK.
TESTED.

Simply restart your PC, it sounds silly but works most of the times.,
I don't have avast in my PC, but still ran into this problem.
Just restarted my PC and debug worked, I'm not sure what might be the problem exactly though.

Sometimes when you try to debug your application, you will get the error like
Cannot connect to VM
com.sun.jdi.connect.TransportTimeoutException
FATAL:----------
ERROR:------------
ERROR:----------
WARN:-------------
I suggest you to turn-off your AVAST! FIREWALL and restart your system and then try debug your application. It will work fine.
Thanks
Lokesh

For me I had this issue when starting up the jetty-server and McAfee Antivirus Protection software was installed in my Windows 7 64 bit PC and as other mentioned I diabled the Firewall option and restarted eclipse workspace and started the server again. It worked!!!
Listening for transport dt_socket at address: 9000
I doubt there is a way to enable the port without disabling the firewall or maybe whitelist the specific port to be allowed by my antivirus softwares since this wont change often. Will post an update if I find one.

I had a similar problem, when working with scrapbook. Fireval was in game mode. Then I turned off Fireval and scrapbook began to work.

Same symptoms appeared quite suddenly after my setup had worked nocely for long time. The reason appeared one invalid line in my /etc/hosts file (I had added virtual NIC's ip there with translation to 'localhost'). Removing that line fixed it.
For someone with C background it is bit surprising that Eclipse reads /etc/hosts when you are debugging local Java application, but that appears to be the case.

If you use a Windows OS, maybe this command can help you:
netsh winsock reset

I got this:
Unable to launch scrapbook VM
com.sun.jdi.connect.TimoutException
I shut down Eclipse, disabled the Avast! firewall (as recommended but only for for 10 minutes), restarted Eclipse at which point I got a message from the Windows firewall about having blocked some Eclipse features.
I checked the "public networks" checkbox (I'm on an employer provided network through wifi), restarted Eclipse and "voila", it is working again.
Windows Firewall Notification - Screen grab

In my case, it was a matter of running Eclipse as Administrator. Once I did that, problem solved.

In my case on a Mac, the "debug attach" block in launch.json was set to port 0.
I simply changed it to something else (8899), and it worked.

My debugger was timing out before the test connected to the JRE.
I increased my java/debug 'debuggger timeout' setting and was able to run the test.
Reference:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=123118

I fixed it by increasing these settings

In my case it worked just by disabling the word wrap setting on the eclipse console

Related

Tomcat error? Or something else?

My problem is that sometimes when i'm working in Eclipse IDE (using Tomcat 8),something goes wrong.It gives me a HTTP 404 error code, which seems obvious for the first look, but the problem is not with the configuration or anything like that,because this happens even with working projects.The only difference i see is that the tomcat is starting faster when i run the project(then i know i will get a 404 error),even if that worked before.Or its loading faster as i mentioned but when i change something its not "loading" that.But here comes the interesting thing,if i make changes in the design which worked already, the changes appears after a refresh/restart.But for example if i delete or change a controller that keeps working or not(depends how was before)One more interesting thing.When i get 404 error and i see its loading faster, and i try to start the server again without stop it,its not asking me if i want to restart it...just brings up the index page.So sometimes its not working the project at all....(404 error)...and sometimes just not "updadeting" it.When this happens i try to clean tomcat/web directory, clean the project, restart the tomcat several times or just restart Eclipse.But even all this sometimes has no effect,and i loose a lot of time with it...
Anyone faced something similar before?And have a solution for this? Or an idea what causing this?
Thanks in advance.
Without your code, It's hard to determine your issue, but as deep I recognized you must some bits slipped in Tomcat Server Configuration in Eclipse Server.
Install and Configure Apache Tomcat Web Server in Eclipse IDE
You should upload your code so that we can see what is the problem here.
Anyway try reinstalling Tomcat and follow the configuration steps. The error ERROR 404 usually caused when the server could not reach what you requested. In your case the Tomcat is not starting. Reinstall and reconfigure it again.

Internal HTTP server disabled in IntelliJ. Cannot open the project

When I open my project in IntelliJ this error is popping up.
Internal HTTP server disabled: Cannot start internal HTTP server. Git integration, JavaScript debugger and LiveEdit may operate with errors. Please check your firewall settings and restart IntelliJ IDEA
Try like below
Run command prompt as administrator
and run this command netsh winsock reset
Restart your PC
this works form me but i can't say why
BASE FILTERING ENGINE service issues: ERR_NETWORK_ACCESS_DENIED and Can not start internal HTTP server
Disable stop and restart the BASE FILTRING SERVICE
Follow these steps:
go to search panel
write run
write services.msc
search for windows firewall
right click -> properties
go to startup type and transfert into Disabled
clic stop and apply and ok
restart your intellij and enjoy
I had a problem very similar to this. I would have to use Alupotha's answer a couple times a day. When poking around at what could cause the problem, I realized that my Malware Bytes Anti-malware software could be the cause. I disabled it, and my problem went away. If whoever needs to use Alupotha's answer over and over, maybe checking your malware software could be a good thing to check too.

Java ME SDK 3.2 (and 3.3, 3.0 as well) just won't start

When i try to launch it any way, Java ME just freezes. To be more specific, javaw.exe called by device-manager.exe seems to go into infinite loop, since not a single exception or error message is passed. Icon in tray appears, but its menu, instead of devices list, shows only one entry: Exit, which incidentally doesn't work. I can only shutdown it through task manager. And since device-manager is required for emulator, i can't work with it at all.
I tried versions 3.0,3.2,3.3 of Java ME SDK and this problem persists in each one. OS: Windows 7. JDK: 7u25.
I've tried each and every advice i found on the Internet and still can't get it working. Device-manager log shows that the problem starts upon calling "rmiRegistryPortFile".
[2013-07-02 19:20:53.070] DEBUG - strap.BasicObjectConfiguration - Calling create on rmiRegistryPortFile
That's always the last entry in the log.
There was only one way i've managed to get it working - by installing and running it under Windows Virtual PC. Curious thing is, under VM it's working fine in the same very OS (freshly installed Windows 7). But unfortunately that didn't really give much on the cause of the bug, and that's not a solution :( I have to somehow get it working without VM.
I tried reinstalling Windows, that didn't help. Looked through javaw I/O in Process Monitor and compared it with working one. It looks like one of the application threads suddenly shuts down after reading file "rt.jar" (when loading "rmiRegistryPortFile" i guess?), whereas working javaw writes to log-file immediately after that. Windows logs got nothing on the subject: no permission issues, no errors or warnings at the time.
Tried modifying PATH variable to the dir with rmiregistry.exe, did not help. Network sockets are available. Changed DEP settings, same.
Could anyone please help? I've spent days on this bug already.
It's definitely a permission problem. Try to look if any folder related to Java is "READ ONLY".
If you get this error message when trying to run midlets through the built-in emulator of the JavaME SDK 3.0, try disabling DEP for runMidlet.exe.
Data Execution Prevention (DEP) configuration can be found at the following place in Windows: Control Panel > System Security > System > Advanced system Settings > Advanced tab > Performance > Data Execution Prevention.
Add this file to the DEP exclusion list:
<javame-install-dir>\runtimes\cldc-hi-javafx\bin\runMidlet.exe
If things work for you now, complain loudly to Sun (now Oracle) that they need to make software without buffer overflows.
Personally I filed a bug-report against the JavaME SDK 3.0. You should do that too, or make your voice heard on the same bug-report that you're having this problem as well.
Freshly installed windows doesn't have msvcrtXX.dlls
Go to folder runtimes\\cdc-hi\\bin and copy Microsoft.VC80.CRT into runtimes\\cldc-hi-javafx\\bin. This problem will be fixed over autoupdate soon.
Problem with localhost
Please edit <javamesdk_installdir>\\toolkit-lib\\modules\\bootstrap\\conf\\system.properties and change
device-manager.object-registry.host=localhost to: device-manager.object-registry.host=127.0.0.1
Port 1299 might be taken
Please edit <javamesdk_installdir>\\toolkit-lib\\modules\\bootstrap\\conf\\system.properties and change
device-manager.object-registry.port=1299 to: device-manager.object-registry.port=1999
XP 64-bit
Please use 32-bit version of JDK.
Firewall
Make sure that firewall is not blocking communication on ports given in 3. Default port numbers are 1299 for windows and 1999 for Mac.
I have tried all those steps above to no avail, until I replaced my JDK jdk-8u117 with jdk-8u112 (Must be 32 bit) after reading this thread https://community.oracle.com/thread/4009110. I had to restart my machine after changing the Java version because it was not detecting right away after installation. I'm using Netbeans 7.4.

trying to connect to eclipse marketplace gives InvocationTargetException

When I click on "Help / Eclipse Marketplace", I get a popup progress box that says "Retrieving data from http://marketplace.eclipse.org", waits long enough to be a network timeout, then displays the Eclipse Marketplace dialog with a popup that says java.lang.reflect.InvocationTargetException. The "details" button doesn't give anything further, and the "error log" gives a lot of data but does not give me any further information (someone else would know what it means, I guess).
I am on Windows 7 64-bit, running eclipse Indigo 3.7; as part of working on this problem, I did a "help / check for updates" and let it loose. I ran it again and it said no updates were found.
I have looked at internet settings in IE (which I never use) and in Chrome (my default browser); both of them are set to auto-detect network connection settings. The machine is in my home, using a wireless router to a cable ISP, so I don't think any proxy should be necessary. However, I'm a programmer, not a network person, would be happy to learn about something else there that should be checked.
I enabled telnet on the windows machine and executed "telnet marketplace.eclipse.org 80"; it cleared the command screen and appeared to be waiting for input. I entered the telnet control character and it popped back to the dos prompt. There seems to be no connection issue to that domain on port 80.
My runtime environment is java 1.6.0_24; jre6 is the only installed execution environment that shows up in eclipse ("Windows / Preferences / Java / Installed JREs").
I found one post that claimed that turning ON Windows firewall fixed his issue; I looked and was displeased to find that Windows firewall was already turned on for my machine; I turned it off, but it did not change the error. (I have a hardware firewall, don't know why I would need Microsoft's or BitDefender's.)
There are several SO posts on the subject, but none of them seem to fit me closely enough; some of the things I have tried above came from those posts.
There are one or two reported bugs on the issue in eclipse, but they seem to be at least a year old and are reportedly fixed.
Can someone please tell me how to solve this, or at least where to look?
http://h-online.com/-1797226
Read the article above. They were moving their servers and they hope to finish Sunday afternoon.
i did all the work around.. finally installing JRE 6 worked like a magic ... Try this!
try this -vmargs -Djava.net.preferIPv4Stack=true

Cannot find a free socket for the debugger in eclipse

when i try to debug the java programe , it says "Cannot find a free socket for the debugger in eclipse".Could you explain how to resolve the error ?
I have found the solution (at least in my case).
Eclipse was installed on a company share drive once I moved it to my local C drive everything worked fine.
As in this thread, you might want to explicitly mention the path of the JVM you are using to execute eclipse.
See this eclipse.ini as an example.
bug 12132 mentioned incorrect socks proxy information.
bug 27654 refered to a configuration problem (firewall, antivirus?)
The usual checks (some are Windows specifics) are:
switch off the vista firewall (it wasn't activated, to be precise)
add a firewall rule for java.exe/javaw.exe/eclipse.exe and reactivated it (just to be sure it didn't interfere although it was deactivated)
deactivated my antivirus tool (avira antivir)
ran eclipse as administrator
disabled UAC
activated/deactivated wired and wireless network interfaces
changed priorities of the network interfaces
used different jvms (1.6 and 1.7)
created an entirely new workspace
I encountered this error message when migrating to a virtual Win10 machine (Eclipse 2019-09) as of November 2019.
My solution was as follows:
First, like Dan above, make sure you do not start eclipse.exe from a network drive, but from C:...\eclipse-dir.
After I did this, Windows Defender Firewall came up with a dialogue informing me that it had 'blocked some features of this app' (eclipse.exe). After I pressed the 'Allow access'-Button, I was able to debug as I had been used to.
It appears that you have to add eclipse.exe to the applications that can communicate through Windows Defender Firewall. If you need to do this manually, go to Control Panel -> System and Security -> Windows Defender Firewall and choose Allowed apps. Press 'Change settings' and 'Allow another app...' to navigate to your eclipse.exe using the file picker dialogue.

Categories

Resources