IntelliJ IDEA not stopping Tomcat server - macos

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.

Related

Tomcat runs different application

I am developing a spring boot app with embeded tomcat server. When I start the project from spring and run it, I see the application which I ran on Virtual machine(windows)'s localhost while I should see my application which I am developing. It's strange that I see the application from virtual machine even when VM is shut down. Does it mean the tomcat has stored it in cache? How do I delete that data? I am using mac OS catalina.
Once run the below command in your terminal to kill your localhost then try
kill -9 $(lsof -t -i:8080)

Keeping the processes running even after exiting SSH to a windows machine

I am connecting to a remote machine through SSH client. Both SSH server and client are on windows OS.
I usually run tomcat 7 from such ssh session. But, as soon as I end the session, tomcat server shuts down as well. I run tomcat7.exe directly from its installation folder.
I have used &! at the end of the command to ensure that the process doesn't get attached to the terminal. But, couldn't achieve the desired result.
Kindly suggest how to detach such processes from the ssh client.
tomcat7.exe start and tomcat7.exe stop
these two commands ensure that tomcat starts as a service. Worked like a charm for me.

Is there elegant way to terminate running instance of spring boot stand alone application?

I've been playing with spring boot version 1.5.8 release lately. I was able to stand it up as rest web service to handle incoming request.
This is how I activate the service. Note: linux environment.
nohup java -jar fooservice.jar &
Then I tail the nohup.outfile to monitor the start up process, any incoming request, any exception thrown and etc.
My question is how to terminate the instance of the program? I run ps -ef | grep command to find pid of the running instance then run kill -9 command to terminate it.
Is there elegant way to stop the service?
You can shutdown spring boot application by enabling actuator shutdown end point /actuator/shutdown, first we need to enable it here
management.endpoint.shutdown.enabled=true
endpoints.shutdown.enabled=true
And then invoke it
localhost:port/actuator/shutdown

can't shutdown tomcat service on Mac

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

Port conflict while running Integrated weblogic Server in JDeveloper

The message i see when i try to run Integrated Weblogic server is
Port conflicts have been detected and the affected ports have been automatically reassigned to available ports.
Then I am unable to start my server. I have tried restarting the server but it did not help.
Windows
Press Ctrl+Shft+Esc click on Processes, End the JDeveloper(jDev64W.exe in my case) and Java instances(java.exe in my case). Now restart the JDeveloper and try running the Integrated Weblogic Server again.
Linux
Use the command jps -l. Select the process id corresponding to weblogic.server.
Use kill -9 <process-id> to kill the running instance
If it still does not work, restart the computer to ensure all the ports have been released.

Resources