Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging is not working in Netbeans Tomcat

I am getting the following error when I am trying to Debug my project in Netbeans 8 IDE , I am using Apache Tomcat 8.

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: failed to create shared memory listener: Cannot create a file when that file already exists
ERROR: JDWP Transport dt_shmem failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750

I am not able to understand the problem.

Can somebody please explain me the problem, cause of the problem and solution.

Thanks

like image 539
Shivkumar Mallesappa Avatar asked May 31 '16 10:05

Shivkumar Mallesappa


People also ask

What is attach debugger in NetBeans?

It also offers you events to listen to. These events might be breakpoints, or exceptions. So "attaching a debugger" means registering your debugger as a listener to these events and register it to be able to interact with your running program.


4 Answers

I had the same problem and was indeed caused by what hello_earth mentioned. Probably when you open you taskmanager you will see that multiple java se processes are running. Kill them both and then it works again.

like image 180
Diceble Avatar answered Sep 27 '22 04:09

Diceble


Somewhere, the port has been occupied, you have to check where. (Sometimes it could be skype). Also, you can try to override the default value to some else parameter in local.properties file.

tomcat.debugjavaoptions=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8005,suspend=n
like image 44
BohdanZ Avatar answered Sep 28 '22 04:09

BohdanZ


In Netbeans, go to: Services tab >> Servers >> Apache Tomcat >> Click Properties >> Startup tab >> Debugger Transport: Choose (Socket Port) instead of shared memory.

like image 28
TiyebM Avatar answered Sep 25 '22 04:09

TiyebM


in my case this happened after killing / or trying to force kill a hanged tomcat instance which was started from the Netbeans. either it was not completely killed (some left open file?), or somehow was spawned again by Netbeans after i killed it. killing tomcat and restarting netbeans solved the issue for me.

like image 44
hello_earth Avatar answered Sep 27 '22 04:09

hello_earth