Thank you so much for working with me on this. I am on mac OS, and I am
using tomcat-7.0.50
1. Here is my server.xml without comments -
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
2. My startup port is 8080. Here is what I see after starting up - Its blank
myMAC-dev:bin test$ lsof -i TCP | grep 8080
myMAC-dev:bin test$
3. Where can I get startup log file?
On Fri, Feb 14, 2014 at 11:16 AM, Neven Cvetkovic <[email protected]
> wrote:
> On Fri, Feb 14, 2014 at 2:03 PM, Caldarale, Charles R <
> [email protected]> wrote:
>
> > > From: Leo Medina [mailto:[email protected]]
> > > Subject: RE: Unable to shutdown Tomcat
> >
> > > Hello have you tried:
> > > ps -ef | grep <port number>
> > > kill -9 <port number>
> >
> > You must have extremely odd implementations of ps and kill if you expect
> > that to do anything useful. Are you confusing port number with pid?
> >
> > - Chuck
> >
>
> Nice catch Chuck.
>
> Leo, you probably confused two: netstat and ps commands.
>
> ps -ef | grep <port_number>
>
> would work only if you provide port number on the command line of your
> program, and that's not the case in default out-of-box Tomcat (uses
> server.xml to define port numbers)
>
> I would suggest:
>
> ps -ef | grep java
>
> would output the command line of all Java processes, and Tomcat is one of
> them.
> note the process id (PID) for your specific tomcat process
>
> and then try killing the process, e.g.
>
> kill <PID>
> kill -9 <PID>
>
> I prefer looking at netstat, as I might have multiple Tomcat instances
> running, so I want to know exactly which one I want to "kill" ...
>
> Netstat behaves differently on different OS. This is what I typically use
> when troubleshooting my tomcat instances (knowing that it runs on port
> 8080):
>
> netstat -aon | findstr 8080 (windows)
> netstat -vatpn | grep 8080 (linux)
> lsof -i TCP | grep 8080 (mac)
>
>
> So, to further troubleshoot your problem - we need:
>
> 1) server.xml (as Chuck pointed out - without comments)
> 2) startup logfile
> 3) output of netstat (lsof) after the tomcat startup
>
> Good luck!
>