Added the possibility to start Tomcat in debug mode #1

Closed
biagio.peccerillo wants to merge 1 commits from (deleted):master into master
4 changed files with 24 additions and 1 deletions

View File

@ -94,6 +94,8 @@ tomcat_m_jmx_port: 8186
tomcat_m_jmx_disable_additional_ports: True
tomcat_m_jmx_localhost_only: False
tomcat_m_jmx_ip_address: '{{ ansible_default_ipv4.address }}'
tomcat_m_jpda_port: 5005
tomcat_m_jpda_opts: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address={{ tomcat_m_jpda_port }}"
# tomcat_m_jmx_auth_dir: '{{ tomcat_m_instances_base_path }}'
# tomcat_m_jmx_monitorpass: define_in_a_vault_file

View File

@ -299,6 +299,18 @@
notify: tomcat multiple-instances restart
tags: ['tomcat', 'tomcat_instances', 'tomcat_init']
- name: Install the debug conf used by the systemd unit
ansible.builtin.template:
src: tomcat-debug.conf.j2
dest: "/etc/systemd/system/tomcat-instance-{{ item.http_port }}.service.d/debug.conf.disabled"
mode: "0644"
owner: root
group: root
loop: '{{ tomcat_m_instances }}'
when: tomcat_use_systemd_unit
notify: tomcat multiple-instances restart
tags: ['tomcat', 'tomcat_instances', 'tomcat_init']
- name: Install the tomcat instances default file
ansible.builtin.template:
src: tomcat-default.j2

View File

@ -0,0 +1,3 @@
[Service]
Environment="{{ tomcat_m_jpda_opts }}"
Environment="JPDAEXEC=jpda"

View File

@ -15,6 +15,7 @@ set -e
[ -n "$JSP_COMPILER" ] && JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=\"$JSP_COMPILER\""
export JAVA_OPTS
export JPDA_OPTS
# Enable the Java security manager?
SECURITY=""
@ -22,4 +23,9 @@ SECURITY=""
# Start Tomcat
cd $CATALINA_BASE && exec $CATALINA_HOME/bin/catalina.sh run $SECURITY
if [ -n $JPDAEXEC ]; then
echo "Starting Tomcat with JPDA debugger support"
echo "JPDA_OPTS: \"$JPDA_OPTS\""
fi
cd $CATALINA_BASE && exec $CATALINA_HOME/bin/catalina.sh $JPDAEXEC run $SECURITY