Facing issue with Tomcat execution in eclipse - java

I tried uninstalling and reinstalling tomcat after removing the server instance from the eclipse environment. I spent so much time yet there is no use. This is the error I keep receiving.
Error in the eclipse environment.
It says that the port 8080 required by Tomcat is in use. But in port 8080 only tomcat is running. I am attaching a screenshot for the same.Ports in Resource Manager.
Please help me resolve this issue, Thanks in advance!!!.

netstat -ano | findstr :
for example, use the below command in the terminal or cmd
netstat -ano | findstr :8080
find the process id
and then use
taskkill /PID /F
to kill the task.

Related

Eclipse closed automatically

When I was running my project on 8080 port immediately the eclipse closed automatically and the port is still running with the project, I reponed and I can't run the project on 8080 port anymore.
In Mac OS.
[sudo] lsof -ti:8080 | xargs kill should pull up the PID binding to 8080 and kill it

Shell script to validate if my tomcat is running or not - uniquely identify

I see many shell scripts to check process if that is running we proceed further.
But there is scenario like below or if we have multiple tomcat running on single host, how do we identify if our process running?
e.g if I go to path /opt/alfresco/tomcat/bin and execute command
ps -ef | grep tomcat
It will give me output (even tomcat is not running)
[alfresco#host030 bin]$ ps -ef |grep tomcat
alfresco 12090 11302 0 22:57 pts/0 00:00:00 grep tomcat
[alfresco#host030 bin]$
So if I am using alfresco tomcat and I need to validate if my tomcat process actually started and running, how do I validate?
Also to differentiate between any java and tomcat running, HOW ?
You can try with the below script. Do grep for the listening port, use your port number.
JAVA_HOME=/usr/java/default
SHUTDOWN_PORT=`netstat -vatn|grep LISTEN|grep 8005|wc -l`
export JAVA_HOME=$JAVA_HOME
if [ $SHUTDOWN_PORT -ne 0 ]; then
echo 'Alfresco is running'
else
echo "Alfresco is not running"
To start it you can use
ALF_HOME=/www/web/dev1/alfresco
$ALF_SCRIPT start
If your tomcat is running as a service you can run service tomcat status.
If its not running as service its recommended to do it..
Read this how to do it: https://www.linux.com/learn/managing-linux-daemons-init-scripts

IOS Webkit Debug proxy issue - Unable to bind device

I am trying to start ios webkit debug proxy by passing the udid and the port number.
Command: ios_webkit_debug_proxy -c 4ea8dd11e8c4fbc1a2deadbeefa0fd3bbbb268c7:27753 -d.
Facing issue while binding the device on port number 27753. Error message,'Unable to bind udid on port 27753-27753'
Check this web link https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md, if it helps.
Most likely it cannot be bind to the port since it's already taken.
Check if the port is taken by another process (or same type of process that is hanged by some reason) by running sof -t -i tcp:27753 command in terminal.
To find and kill process run sof -t -i tcp:27753 | xargs kill command in terminal, but it's not safe to do in case if you have parallel execution and/or not only ios_webkit_debug_proxy is using port 27753.

how to stop all ports in apache tomcat

While developing a web application using Apache Tomacat and Eclipse frequently I get this message
Several ports (7354, 6544, 9999) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
I know that this ports are in use, but I don't if I stop all those servers also why get the same message. My question is - Is there any way to stop all ports at once in using Eclipse or Windows 7 ?
you can use the lsof in combination with awk. do the following:
lsof -i :<portnumber> | awk '{print "kill -9 "$2}' | sh
if you want to know only the processId from the port, use:
lsof -i :<portnumber> | awk '{print $2}'
btw: i have this problem sometimes too. If you're using eclipse check in the debug view if there is still a thread of the tomcat running. if so, stop them :)
Otherwise restart eclipse.
Have you tried the following?
ps -ef | grep <port number>
kill -9 <process id>

Address binding issue

I am trying to run a web application (which is a servlet + gradle project). I am using Jetty to run the application. When I run the application , I am getting the error:
Address already in use
Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.0-bin.zip'.
When, I enter localhost:8080 , I used to get jenkins default page, So I uninstalled jenkins and tried again, but getting the same error.
Please help in resolving this issue, also how do we get to know which application is running on corresponding port?
You can use the command "netstat". Look for the line in which the column "remote address" ends with ":8080".
Depending on the OS you're running:
Windows:
netstat -b -n -a -p TCP
The process is printed above the line.
Linux:
netstat -a -n -p | grep 8080
The process is printed as the last column of the line.

Categories

Resources