debugging java application deployed in tomcat

后端 未结 7 1548
刺人心
刺人心 2021-02-01 03:31

I have an application that I deployed in tomcat. Later I configured the code as a project in Eclipse. I want to connect to the tomcat via eclipse and debug the application. Tryi

7条回答
  •  借酒劲吻你
    2021-02-01 04:32

    Debug worked for me. I was using tomcat 8, configured on centos 7. Debug port opened for me after changing 2 settings.

    1. Open tomcat/conf/bin/startup.sh and added below lines
    export JPDA_ADDRESS=8000
    export JPDA_TRANSPORT=dt_socket
    
    1. In the same file startup.sh, added jpda before start command.
    exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
    

    Restart the tomcat. In eclipse go to Run>Debug configuration>Remote java application>Add host ip and port(8000) where tomcat is running. In my case i required to open 8000 through firewall too.

    firewall-cmd --zone=public --permanent --add-port=8000/tcp
    firewall-cmd --reload
    

提交回复
热议问题