find pid of tomcat running servicedesk

Document ID : KB000112182
Last Modified Date : 27/08/2018
Show Technical Document Details
Introduction:
The stop and restart tomcat may sometine produce an error about port in use on restart.
Strongly suspecting the stop was not ended properly. We are looking for the pid of tomcat process running ServiceDesk
Question:
On the server running ServiceDesk, we see many java.exe and javaw.exe process

How to identify which one is from servicedesk ? The intent is to kill it from the OS and make sure nothing is running with allocate of the port.
Environment:
Windows 2012
ServiceDesk 14.1, 17.X
 
Answer:
At the CMD prompt, execute

nxcd log
find/i "process started" stdlog.* | find/i "pdm_tomcat.c" | find/i "pid="

-> We would see result like this
<<
..... pdm_tomcat          10536 SIGNIFICANT  pdm_tomcat.c          1381 SERVICEDESK Tomcat javaw process started (pid=11252)
..... pdm_tomcat          10936 SIGNIFICANT  pdm_tomcat.c          1381 VIZ Tomcat javaw process started (pid=12568)
..... pdm_tomcat           9708 SIGNIFICANT  pdm_tomcat.c          1381 FS Tomcat javaw process started (pid=12604)
..... pdm_tomcat           9632 SIGNIFICANT  pdm_tomcat.c          1381 SA Tomcat javaw process started (pid=10084)
..... pdm_tomcat           6400 SIGNIFICANT  pdm_tomcat.c          1381 REST Tomcat javaw process started (pid=10204)
>>

With this sample, the pid of SERVICEDESK is 11252

-> On your testing machine, would be possible to kill it
taskkill /f /t /pid 11252

To restart tomcat, execute
pdm_tomcat_nxd -d start