I'm to use the Java debugger in the terminal for Mac, and it seems to let me use it randomly. Sometimes it works, but other times it gives me this message:
run
run Lab5 commands1.txt
VM start exception: VM initialization failed for: /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/java -Xdebug -Xrunjdwp:transport=dt_socket,address=Uzomas-MacBook-Air.local:49188,suspend=y Lab5 commands1.txt
ERROR: transport error 202: getaddrinfo: unknown host
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [:732]
I've researched solutions for this but never understood how to implement them, and I don't have enough reputation to comment so this is my only way
Related
I’m trying to develop a Java smart card recently. I have installed NXP JCOP Tools for Eclipse in Eclipse, but it still doesn’t work, and the error is reported as follows
- /term "Remote|localhost:49328"
jcshell: Cannot init/open terminal: Failed to open [localhost:49328]: Connection refused: connect
/card -a a000000003000000 -c com.ibm.jc.CardManager
jcshell: Error code: -8 (Failed (no diagnosis))
jcshell: Command failed: No ATR
Unexpected error; aborting execution
When I start my Tomcat 7 from Eclipse, I usually add something like
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8101
to its launch configuration, since I sometimes want to attach the Eclipse debugger remotely later. But when I do this and try to shut down the Tomcat from Cclipses "servers" view, I receive the error
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
I assume this is because Eclipse starts a new process that normally tells the running Tomcat to shut down, and also uses the debugging arguments I introduced in to the launch configuration. This process fails, since the named port 8101 is already used. Does anybody have an idea to allow a clean Tomcat shutdown in that setting?
(I do not want to start the Tomcat in Debug mode in the first place since that slows down both eclipse and the Tomcat. Neither do I want to restart it in debug mode when I want to debug, since that takes quite some time.)
In Tomcat's server.xml
<Server port="8005" shutdown="SHUTDOWN">
The setting can be used to shutdown Tomcat. You can write a simple program and run it.
import java.net.*;
public class t {
public static void main(String[] args) throws Exception {
Socket s = new Socket("127.0.0.1",8005);
s.getOutputStream().write("SHUTDOWN".getBytes());
s.close();
}
}
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [util.c:840]
This seems to be an old error in Eclipse, it's a known bug from a few years ago. I am just wondering:
What issues does it cause, as my program seems to run just fine?
Any wild clue when will it be fixed?
Any way to get rid of it temporarily?
I am using Ubuntu 15.04, java 1.7and mysql 5.6. I am not using any server
I have a demo application where I am trying to fetch the data from db.
When i run the program from main method in the log I am getting null pointer exception.
To check when I am trying to debug as java application, I am getting an error message saying
ERROR: transport error 202: connect failed: No route to host
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]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
What is the cause of this error?
how to resolve this?
I got this message using folowing command:
-agentlib:jdwp=transport=dt_socket,address=8000,server=n,suspend=n
Changing to
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
solved the problem.
I'm getting the following error when I try to debug a simple local "Hello World" application. But the same application runs fine.
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]
Debugging local applications used to work on my Eclipse (Kepler on Windows 7). I'm able to ping localhost.
I tried:
Turning off firewall.
Changing JRE libraries. (changed to jdk)
Doing a clean Java Installation.
Uncommenting "127.0.0.1 localhost" in etc\hosts
The issue is still not resolved. Is there anything else I can try.
The issue has been resolved. I had recently upgraded Avast Antivirus. Avast 2014 was causing the issue. I had tried deactivating Avast, but this did not fix the issue. Uninstalling Avast completely fixed the issue. I have switched to Avira now.