Netbeans on OSX Yosemite: Starting Tomcat in debug mode is failing

I have installed Tomcat8 using homebrew on OSX 10.10.3.

Here is how I have configured tomcat-users.xml:

<tomcat-users xmlns="http://tomcat.apache.org/xml" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" 
  xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd">

    <role rolename="manager-script"/>
    <role rolename="admin"/>
    <user password="admin" roles="manager-script,admin" username="admin"/>

</tomcat-users>

Tomcat8 starts from Netbeans and deploys my war correctly, except when in debug mode.

When I start in debug mode, I get the following error: Starting of Tomcat Failed
and the following output is generated in the Tomcat log:

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 [debugInit.c:750]

To me this is saying that the dubugging port is being locked by another process. Based on the catalina.sh file, the JPDA_ADDRESS=”localhost:8000″.

I’m new to Mac, so in this case, with Windows, I would just kill the java processes running in the Process Explorer.

I found some articles suggesting to execute netstat commands and others mentioning to uses the lsof command to look for the PID to kill.

However neither commands rendered results for port 8000 so I logged out in an attempt to close whatever app is using the port.

After logging back in the problem remains. What gives? What secret mac trick am I not finding??


Source: java

Leave a Reply