我已将 eclipse 配置为能够启动(用于调试:使用 jpda)和停止 tomcat 作为程序。我第一次从eclipse启动/关闭tomcat是成功的。但是第二次尝试启动tomcat时出现以下错误:
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 [../../../src/share/back/debugInit.c:690]
我认为当我从 Eclipse 运行关闭 tomcat 时,端口永远不会关闭。如果我重新启动计算机,端口将被释放,我可以从 eclipse 再次运行 start tomcat。但是每次我无法重新启动计算机以使其正常工作..寻找一个不太激进的解决方案...
这就是我配置我的 Eclipse 以将 tomcat 作为程序运行的方式。
Configured the external tool configuration in eclipse
catalina script points to catalina.bat on my Windows machine
under arguments : jpda run
In the Environment tab.
"JPDA_ADDRESS" as the name and "8000" as the value
"JPDA_TRANSPORT" as the name and "dt_socket" as the value
"JAVA_OPTS" as the name and -server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=160m -Djava.awt.headless=true as the value