简体   繁体   中英

Tomcat debugging not possible through eclipse

I've made a script called debug.sh and placed it under the bin directory (start it with ./debug.sh ) to start Tomcat 8 in debugging mode:

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
bash catalina.sh jpda start

But if it started, there is now message which says, that Tomcat is listening on port 8000. Also if I type

netstat -nat

there is no application listening on port 8000.

What exact configuration do I have to set, to remote debug my Tomcat 8 server which is running on a specific IP or do I have just a little problem in my script?

This answer has been updated following the comments, I did not understand the problem in the first place.

I guess you have followed that doc : this is about developing Tomcat itself.

I am not sure you are using the proper way to configure the port (I don't know your specific configuration details). In a standard environment, the ports are configured in the server.xml (note that several different ports are used by Tomcat for the different services).

To remotely monitor your server, you should use a JMX client. As far as I know, Eclipse doesn't include one (or at least not one documented) - you could code one as this is a Java specification (JSR262) . You have one in a standard Java environement ( JConsole ). By default, JMX is not enabled on Tomcat. If you need to enable it, the fine way is to follow the doc .

Tomcat JMX monitoring and JConsole are both available in most versions of Tomcat and the Java runtime.

The following exchange seems to be about your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM