You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark van Wyk <ma...@gondwanaalive.org> on 2006/07/26 16:14:11 UTC
Shutdown Problems with Tomcat
Hi Folks,
Apparently this is quite a common problem. It's important for me to solve
though. I'd appreciate any advice I can get. Please note that I'm not a Java
expert. Just getting Liferay working was a miracle achievement. I'm also not
a Linux guru, but manage to get my way around with both, eventually.
I'm using Tomcat, standalone, without the APR's on MAC OS X 10.4 using JRE
5.0 update 6. I'm using Liferay 4.0.0 too.
1. I start Tomcat with no problems. I do to the home directory and specify $
./startup.sh
2. Everything works fine. cataline.out is very positive.
3. If I type $ netstat -a, I get
tcp4 0 0 localhost.8005 *.* LISTEN
tcp46 0 0 *.8009 *.* LISTEN
tcp46 0 0 *.http-alt *.* LISTEN
Somehow, that feels right, although I don't really know what it means.
4. Then I say ./shutdown.sh
5. Everything "seems" fine according to the command prompt, but just wait
till you see what catalina.out has to say about it!
6. Catalina.out says:
14:08:28,983 INFO [org.apache.coyote.http11.Http11BaseProtocol] Pausing
Coyote HTTP/1.1 on http-8080
14:09:43,603 ERROR [org.apache.catalina.connector.Connector] Protocol
handler pause failed
java.net.ConnectException: Operation timed out
...
...
...
14:09:47,861 INFO [org.apache.coyote.http11.Http11BaseProtocol] Stopping
Coyote HTTP/1.1 on http-8080
Failed to shut down: java.lang.NullPointerException
java.lang.NullPointerException
at org.activemq.broker.BrokerContext.deregisterContainer(
BrokerContext.java:70)
Can anyone please offer me sone advice?
Thanks,
--
Mark van Wyk
Portal Co-ordinator
www.GondwanaAlive.org
"Promoting Biodiversity and Stemming the Sixth Extinction"
Cell: 082 831 9227 (ZA +27 )
Re: Shutdown Problems with Tomcat
Posted by Mark van Wyk <ma...@gondwanaalive.org>.
Thanks for that! Makes perfect sense. I'm using Liferay, so it's probably in
their pile of code that the problem arises. I'll ask them for some advice!
On 7/26/06, Shankar Unni <sh...@netscape.net> wrote:
>
> Mark van Wyk wrote:
>
> > tcp4 0 0 localhost.8005
> *.* LISTEN
> > tcp46 0 0 *.8009
> *.* LISTEN
> > tcp46 0 0 *.http-alt
> *.* LISTEN
> >
> > Somehow, that feels right, although I don't really know what it means.
>
> Yes, that's correct. It means tomcat is listening on only the localhost
> (127.0.0.1) interface on port 8005 (for the shutdown command), and on
> all network interfaces on port 8009 (for mod_jk) and whatever your
> http-alt port is defined as in /etc/services (probably 8080).
>
> Nothing unusual here.
>
> > 14:08:28,983 INFO [org.apache.coyote.http11.Http11BaseProtocol] Pausing
> > Coyote HTTP/1.1 on http-8080
> > 14:09:43,603 ERROR [org.apache.catalina.connector.Connector] Protocol
> > handler pause failed
> > java.net.ConnectException: Operation timed out
>
> And
>
> > 14:09:47,861 INFO [org.apache.coyote.http11.Http11BaseProtocol]
> Stopping
> > Coyote HTTP/1.1 on http-8080
> > Failed to shut down: java.lang.NullPointerException
> > java.lang.NullPointerException
> > at org.activemq.broker.BrokerContext.deregisterContainer(
> > BrokerContext.java:70)
>
> Looks like you have a Servlet with a destroy() method that tries to make
> a call to an MQ server, and that is first timing out, and then the class
> gets a NullPointerException.
>
> When a webapp is being undeployed, all the destroy() methods in Servlets
> are called *synchronously* by Tomcat.
>
> Doing any heavy-weight work in Servlet destroy()s (e.g. DB calls, MQ or
> other remote calls, etc.) is a common source of "shutdown hangs".
>
> If you must do something like this:
>
> * Start the work in a thread, and
> * do a Thread.join() *with a timeout*, so that the shutdown is not hung
> forever if something goes wrong in your cleanup operation.
> (perhaps log an error if the thread join timed out..)
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Mark van Wyk
Portal Co-ordinator
www.GondwanaAlive.org
"Promoting Biodiversity and Stemming the Sixth Extinction"
Cell: 082 831 9227 (ZA +27 )
Re: Shutdown Problems with Tomcat
Posted by Shankar Unni <sh...@netscape.net>.
Mark van Wyk wrote:
> tcp4 0 0 localhost.8005 *.* LISTEN
> tcp46 0 0 *.8009 *.* LISTEN
> tcp46 0 0 *.http-alt *.* LISTEN
>
> Somehow, that feels right, although I don't really know what it means.
Yes, that's correct. It means tomcat is listening on only the localhost
(127.0.0.1) interface on port 8005 (for the shutdown command), and on
all network interfaces on port 8009 (for mod_jk) and whatever your
http-alt port is defined as in /etc/services (probably 8080).
Nothing unusual here.
> 14:08:28,983 INFO [org.apache.coyote.http11.Http11BaseProtocol] Pausing
> Coyote HTTP/1.1 on http-8080
> 14:09:43,603 ERROR [org.apache.catalina.connector.Connector] Protocol
> handler pause failed
> java.net.ConnectException: Operation timed out
And
> 14:09:47,861 INFO [org.apache.coyote.http11.Http11BaseProtocol] Stopping
> Coyote HTTP/1.1 on http-8080
> Failed to shut down: java.lang.NullPointerException
> java.lang.NullPointerException
> at org.activemq.broker.BrokerContext.deregisterContainer(
> BrokerContext.java:70)
Looks like you have a Servlet with a destroy() method that tries to make
a call to an MQ server, and that is first timing out, and then the class
gets a NullPointerException.
When a webapp is being undeployed, all the destroy() methods in Servlets
are called *synchronously* by Tomcat.
Doing any heavy-weight work in Servlet destroy()s (e.g. DB calls, MQ or
other remote calls, etc.) is a common source of "shutdown hangs".
If you must do something like this:
* Start the work in a thread, and
* do a Thread.join() *with a timeout*, so that the shutdown is not hung
forever if something goes wrong in your cleanup operation.
(perhaps log an error if the thread join timed out..)
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org