Previously i was using Tomcat-v.8.5.75 which will run as a windows service in my project, Currently i have updated to tomcat-v.9.0.85, so in my project, in a particular action a jar will be called which will perform the tomcat restart (i.e) inside the jar i have used cmd commands to stop and start the tomcat (net stop tomcat) and also maintain the log for that. But in updated tomcat version this functionality is breaking. Exactly when i use “net stop tomcat” all other action below that is not performing and log lines before the “net stop tomcat” command is also not printing but empty log file is created and tomcat stop is happening, start is not performing. But if i run the jar file the stop and start of tomcat service is performed and log is also printed. While calling the jar from my code stop is alone performed and other implementations are failing.
After analyzing about the latest version have found some clues. All the version above the Tomcat-v.8.5.85 in 8.5.x series and all the versions above the Tomcat-v.9.0.70 the issue is occurring. So by comparing the change log of the these particular versions,(check change log of 8.5.85 “https://tomcat.apache.org/tomcat-8.5-doc/changelog.html” and change log of 9.0.70 “https://tomcat.apache.org/tomcat-9.0-doc/changelog.html” ) there are some common updates here i would highlight “Update to Commons Daemon 1.3.3“ because I have tried replacing the tomcat9.exe file of the v.9.0.70(which has Apache Commons Daemon Service Runner version of 1.3.3.0) with older version v.9.0.69(which has Apache Commons Daemon Service Runner version of 1.3.2.0) and the issue does not occurred.
would like to hear any suggestion that i need to make to make this work.