OS X: Cannot start Glassfish in debug mode any more - java

Suddenly, Glassfish doesn't start in debug mode any more. I get the following error:
objc[4235]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
ERROR: transport error 202: connect failed: Connection refused
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)
Command start-domain failed.
The DAS was stopped.
I have not other process running on the debugger port (9009). I'm using Java 7, Yosemite, and Glassfish (tried 3 and 4).

The error seems to be caused by using the wrong debug-options "jdwp=transport=...,suspend=y".
These settings are needed for local debugging (if Glassfish is started by another process, e.g. by IntelliJ).
Another option is to start Glassfish first with debug settings "server=y,suspend=n" and then attach a debugger remotely.
See this comment to IDEA-95585 for further explanations regarding IntelliJ.

Related

Unable to debug in Eclipse( Mac)

I have Eclipse in Mac and when I am trying to debug the application, its throwing me this error.
ERROR: transport error 202: gethostbyname: unknown host ERROR: JDWP
Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP
exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
[debugInit.c:750]......
Even "Ping localhost"command is not fetching results.
Googled a lot but no solution works.
check /etc/host if 127.0.0.1 localhost is commented out
Also read this

Unable to run as debug JBOSS project from IntelliJ

I am able to run a JBOSS project without debugging.
However, when I try to run the project in debug mode I get the following message in the event log:
5:02:17 PM All files are up-to-date
5:02:21 PM All files are up-to-date
5:02:21 PM Error running ProjectConfiguration
Invalid arguments : Already listening
[timeout, port, localAddress]
I have killed all the java.exe processes on my machine. Any ideas?
Update
I setup a fresh project completely. I am now getting the following:
6:06:56 PM Error running JBOSS Local: Unable to open debugger port (127.0.0.1:9157): java.net.SocketException "socket closed"
6:06:56 PM Application Server was not connected before run configuration stop, reason:
Unable to ping server at localhost:8080
AND this:
ERROR: transport error 202: failed to attach to shared memory connection: The system cannot find the file specified
ERROR: JDWP Transport dt_shmem failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Disconnected from server
Perhaps you could try remote debugging by starting JBoss with this uncommented in bin/standalone.conf.bat:
-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n
Then in IntelliJ, start a remote debug session against localhost:8888.

When yarn starts for remote debugging, I have encountered the follow error?

I have yarn cluster with two virtual machine. And I want to remote debugging with eclipse. And I add this code block in yarn-env.sh
YARN_OPTS="$YARN_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999"
When yarn starts for remote debugging, I have encountered the following error,
master: ERROR: transport error 202: bind failed: Address already in use
master: ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
master: 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)
Below vmargument is working in commen
-vmargs -Xdebug -agentlib:jdwp=transport=dt_socket,address=2020,server=y,suspend=n

Tomcat starting failure due to timeout in Spring source

The issue is : i'm getting timeout errors when starting tomcat inside eclipse and it doesn't start at all in debug mode.
debug mode error :
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection refused
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:741]
normal mode error : Server Tomcat v7.0 at localhost was unable to start within 45 seconds. If the server requires more time...
Please not that i'm starting tomcat without any application deployed.
I've checked ports and they are not used for sure.
Any idea please?
It seems your JDWP is not loading. Here in this article you can get an idea to resolve your problem. Check the answer from Jaikiran Pai in the post. He says that you must use the command line options to load your JDWP.
-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
Hope this can helps you.
Try with this options:-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
The solution is to add memory to tomcat launching (Xms and Xmx VM parameters) script and increase timeout time. This way, the process will never fire a timeout.

Maven Eclipse Debug "JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)"

I'm trying to debug Maven tests in Eclipse. When I launch tests with the maven option maven.surefire.debug, I get this error :
ERROR: transport error 202: bind failed: Address already in use
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
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:690]
/bin/sh: line 1: 27500 Abort trap
It is the same when I tried tu launch debug in my shell.
I tried to add the maven option forkMode=never, and I get another error with my weld artifact that I do not have without the maven.surefire.debug option :
Error loading Weld bootstrap, check that Weld is on the classpath
However, Weld is on my classpath.
Any ideas ?
To kill a process listening on a port:
This command should list processes listening on all ports:
netstat -ano
The -o option will display the process id.
If you're using a *nix system, you can refine a little further with:
netstat -ano | grep <badport>
When you have the process id, you can terminate it with:
Windows:
Open Task Manager, add the PID column with View > Select Columns > PID
Find the process and right-click to kill it
Others:
kill <PID>
For Mac users:
Usually the problem is that another process keeps Maven debug port 5005 open.
So I checked which process keeps this port open by executing:
lsof -i tcp:5005
The output was:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 9089 my_user 7u IPv4 0xe88ec542fd4cffc9 0t0 TCP *:avt-profile-2 (LISTEN)
And then I killed the process:
kill -9 9089
If you want these 2 process to be able to run together, you'll have to change the Maven debug port of at least one of them.
See: http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html.
Go to Debug configuration -> Remote Java Application -> Connect tab, check Allow termination of remote JVM.
Then, when you are going to restart the server/maven, go to Debug perspective and click the read / stop button.....
There is a long time the question was asked but i had the same problem recently.
Open Task Manager
Kill all "java.exe" process
Relaunch the mvn debug
Hope it will help
Just for documentation, I had the exact same error, running on my local:
ERROR: transport error 202: bind failed: Address already in use
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
in my case the port wasn't the issue, but the host file. The solution is to add/re-add/uncomment:
127.0.0.1 localhost
The config file sets localhost as default, so a solution is add that host or change it for a custom one.
To add on.. I had the similar issue last week, when debugging using eclipse was made impossible.
FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_LOAD(196)
ERROR: transport library not found: dt_socket
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)
JDWP exit error AGENT_ERROR_TRANSPORT_LOAD(196): No transports initialized [../../../src/share/back/debugInit.c:690]
Sadly non of the solution I can possibly find online was helpful.
The issue turned out to be that somehow firewall removed all the dlls in my JRE bin... (so dt_socket.dll went completely missing).
Reinstalling the entire JRE helped.
The solution to me was removing the breakpoints of project! If you have many branches and changed recently sometimes eclipse lost some's breakpoints.
first of all remove all debug points in eclipse
search for PID with server port
netstat -ano|find /i "7001"
replace 7001 with your port number in above line
sample o/p
C:\Users\shaithal>netstat -ano|find /i "7001"
TCP 127.0.0.1:51340 127.0.0.1:7001 SYN_SENT 17396
then kill that process
taskkill /F /PID 17396
search for PID with debug port also
netstat -ano|find /i "8453"
8453 is debug port in my case replace 8453 with your port number in above line
sample o/p
C:\Users\shaithal>netstat -ano|find /i "8453"
TCP 0.0.0.0:8453 0.0.0.0:0 LISTENING 19904
then kill that process
taskkill /F /PID 19904

Categories