can't shutdown tomcat service on Mac - macos

I installed the Apache Tomcat/7.0.65 on my Mac, then, run the startup.sh. It works great fine and the service is available immediately. But when I run the shutdown.sh to stop the service. It seems that the shell scripts can not aware of the tomcat running. Would someone please help me with this problem?

I had a similar problem. In my case, although running <Tomcat Root>/bin>./shutdown.sh was technically working (the tomcat process was being killed), the tomcat service was restarting automatically (after a few seconds).
If you run <Tomcat Root>/bin/catalina.sh stop or <Tomcat Root>/bin/shutdown.sh and you see that after a few seconds tomcat restarts => that basically means that you are not able to shutdown tomcat for good. Thus, if you want to make sure that tomcat does not restart automatically, run brew services stop tomcat.
OBS: If you want to find what is your <Tomcat Root> run brew ls tomcat

Related

IntelliJ IDEA not stopping Tomcat server

I am running my Tomcat on my IntelliJ IDE. Whenever I stop my server, via the IDE, it never stops the server. Instead, I have to go manually kill it via the following command in my terminal:
ps -ef | grep tomcat
kill -9 <id>
I am not sure what is causing this issue. Is it safe to kill it every time?
IntelliJ IDEA just calls the standard Tomcat shutdown script. If it can't stop the server, the issue is most likely with the application you have deployed. If the app creates threads and doesn't properly terminate them on the server shutdown, Tomcat will not be able to stop gracefully. You can use jstack to see which threads are running and preventing the server shutdown.

Starting of Tomcat Instance from Jenkins

I installed multiple instances of Tomcat in my Ubuntu machine. I was trying to start Tomcat (one of the instances from multiple Tomcat instances) from Jenkins. Jenkins is showing that Tomcat started. But Tomcat is still in shutdown state only.
In jenkins, When an build completes all the process Id's which are involved in the build are getting killed.
So mentioning BUILD_ID=dontKillMe ./home/tomcat/startup.sh in Execute shell script make it possible.

restarting tomcat instance with bamboo using a function

I'm trying to run a function that we have to recycle our tomcat instance when doing a deploy to tomcat via bamboo. I thought that we would be able to use bamboo's ssh task to call our function tomcat recycle. I am able to run the function ssh connected to the box via putty but in bamboo we get the message:
ksh: tomcat: not found
Does anybody have any experience restarting tomcat automatically via bamboo? Is there a better way?
To restart tomcat via Bamboo
Create a ssh task -
You should be having tomcat service file in /etc/init.d (if you are using redhat)
/etc/init.d/tomcat start
/etc/init.d/tomcat stop
/etc/init.d/tomcat restart
should work

XAMPP Tomcat Not Stopping

I have XAMPP installed on my Windows machine,
I am unable to stop the Tomcat server.
I have tried to kill the process with the Process Id as well,
But weirdly it's not showing in the Task Manager nor the local Services,
Which I referred from here -
apache service not stopping in xampp
Here's my XAMPP Control Panel screenshot -
Here's the Task Manager, I can't find the Process ID 3104 as shown in the XAMPP Control Panel-
I did run the command "Services.msc" to find and stop it but, no luck there either.
You should check the PID and verify that it is not associated with any other service/process mistaken for Tomcat by XAMPP.
In my case I had Jenkins running on port 8080 and starting XAMPP it was "guessing" that Tomcat was already running:
In reality, looking at the PID (198092 in my case) it was associated with java.exe:
and this was a process generated by my Jenkins server running on that port:
This is why you cannot stop Tomcat from there... (it is not Tomcat running on 8080).
To verify this and properly start Tomcat you can try this:
Stopping Jenkins:
Will remove the service running on 8080 and XAMPP is able to correctly detect that Tomcat is not running:
At this point you can Start Tomcat in XAMPP (and it should start for real this time):
Going to the localhost page, port 8080 you will have a proof of it:
If you want you can now successfully stop it from XAMPP:
On Windows:
XAMPP opens a shell(CMD) on starting tomcat just close that shell.

Unable to debug tomcat server using eclipse

I'm using:
Spring Tool Suite Version: 3.2.0.RELEASE
Tomcat v7.0.42
When I just run my tomcat server everything is fine but I'm unable to debug it even locally. It produces following error:
Startich Apache Tomcat v7.0.42 at localhost has encoutered a problem.
Server Apache Tomcat v7.0.42 bat localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
I've tried the following:
increase the timeout.
remove all the apps before starting the debugging.
install new instance of tomcat (the only configuration that I've did on fresh install is turning on Use Tomcat installation and Never publish automatically).
But it didn't help, I still can only run the tomcat, without the debug option. Does anyone know how to make this debugging work?
When I've used new, clear workspace for Spring Tool Suite, debugging started to work.
Cheers,

Resources