Reputation: 450
Tomcat is not starting in debug mode. Getting below logs.
C:\ApacheSoft\apache-tomcat-7.0.67\bin>catalina.bat jpda start
Using CATALINA_BASE: "C:\ApacheSoft\apache-tomcat-7.0.67"
Using CATALINA_HOME: "C:\ApacheSoft\apache-tomcat-7.0.67"
Using CATALINA_TMPDIR: "C:\ApacheSoft\apache-tomcat-7.0.67\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.7.0_79"
Using CLASSPATH: "C:\ApacheSoft\apache-tomcat-7.0.67\bin\bootstrap.jar;C:\ApacheSoft\apache-tomcat-7.0.67\bin\tomcat-juli.jar"
=transport=dt_socket was unexpected at this time.
Upvotes: 9
Views: 3534
Reputation: 973
There is another possibility that you configure both two different ways to enable JPDA in jvm during starting tomcat in remote debug mode.
In windows, there're several ways to enable JPDA in jvm. 1.one way is :
open the startup.bat.
add the lines below
set JPDA_ADDRESS=8001
set JPDA_TRANSPORT=dt_socket
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
2.the second way is:
create a setenv.bat file under CATALINA_HOME/bin directory.
and add the line below:
set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket, address=1043, server=y, suspend=n
of course, they're other ways. I have the same problem with you, but then I found I configured in these ways both, it will result in the failure to open the JPDA port, without any error details. Then I chose the method 1 only, the port was opened successfully. Hope this can help other newbies on this.
Upvotes: 1
Reputation: 1922
Let me guess, you read a link called "HOW TO REMOTELY DEBUG APPLICATION RUNNING ON TOMCAT FROM WITHIN INTELLIJ IDEA" on blog.trifork.com.
The instructions say to do this for Windows in your setenv.bat:
set JPDA_OPTS="-agentlib:jdwp=transport=dt_socket, address=1043, server=y, suspend=n"
Yeah, that's not going to work. catalina.bat adds its own quotes, so it winds up trying to do this:
if not ""-agentlib:jdwp=transport=dt_socket, address=1043, server=y, suspend=n"" == "" goto gotJpdaOpts
A better plan is to do this:
set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n
I know this is from almost a year ago, but I ran into this, and ultimately had to remove "@echo off" from the Tomcat batch files and chase this down myself. Hopefully, this will get voted up so that it can save someone else this grief.
Upvotes: 23
Reputation: 3024
The space char in C:\Program Files\Java\jdk1.7.0_79
cause the problem.
Replace it with short name could solve the problem.
Execute command dir c:\PROGRA~1\Java\jdk1.7.0_79
and check the file list to verify whether PROGRA~1
is correct. If not, try PROGRA~2
and so on...
Then change environment variable JAVA_HOME
or JRE_HOME
to try again.
Upvotes: 0