tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <>
Subject Re: Tomcat fails on restart: BindException
Date Wed, 21 Apr 2010 08:06:10 GMT
On 21/04/2010 08:17, Lara Spendier wrote:
> Dear list,
> I'm really hoping that someone of you is able to help me with my problem!
> Our system: Debian Lenny, Tomcat 6.0.18, mod_jk, Apache 2.2

6.0.18 is getting on now, plan an upgrade of your server(s).

> With the new version of the web application we're using, we have to
> deploy a war-file in tomcat. Everything worked fine at the beginning,
> but in the last week we experienced some problems with tomcat because we
> got the "Service Temporary Unavailable"-Page every now and then. We have
> to restart tomcat every night and I assume that our problem has
> something to do with that. The restart is happening with a cron
> job/shell script that looks like that:
> #!/bin/bash
> cd /root
> /usr/local/tomcat6/bin/
> /usr/local/tomcat6/bin/

The script will probably return before Tomcat has completely
stopped running, which means that the script will try to
start Tomcat before the previous instance has exited.

> In the last week I got a "Service temporary unavailable"-message in the
> morning (every 2 days) and when I got such a message, the log contained
> this error messages:
> Apr 21, 2010 4:35:01 AM org.apache.coyote.http11.Http11Protocol pause
> INFO: Pausing Coyote HTTP/1.1 on http-8081
> Apr 21, 2010 4:35:02 AM org.apache.catalina.core.StandardService stop
> INFO: Stopping service Catalina
> Apr 21, 2010 4:35:31 AM
> org.apache.tomcat.util.digester.SetPropertiesRule begin
> WARNING: [SetPropertiesRule]{Server} Setting property 'debug' to '0' did
> not find a matching property.

You have a debug attribute on the Server element, remove it to clear
this error.

> Apr 21, 2010 4:35:32 AM
> org.apache.tomcat.util.digester.SetPropertiesRule begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
> property 'debug' to '4' did not find a matching property.

Same here.

> Apr 21, 2010 4:35:32 AM org.apache.coyote.http11.Http11Protocol init
> SEVERE: Error initializing endpoint
> Address already in use<null>:8081

There's already a service running on port 8081.
Check that the previous Tomcat actually shutdown completely.

>         at


>         at org.apache.catalina.startup.Bootstrap.main(
> Apr 21, 2010 4:35:32 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 312 ms
> Apr 21, 2010 4:35:32 AM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Apr 21, 2010 4:35:32 AM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
> Apr 21, 2010 4:35:32 AM org.apache.catalina.loader.WebappClassLoader
> validateJarFile
> validateJarFile(/usr/local/tomcat6/webapps/olat/WEB-INF/lib/geronimo-spec-servlet-2.4-rc4.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
> javax/servlet/Servlet.class

You have a Servlet API jar in your webapp (you definitely shouldn't
have), remove it to remove this error.

> Apr 21, 2010 4:35:41 AM org.apache.catalina.realm.JAASRealm setContainer
> INFO: Set JAAS app name Catalina
> Apr 21, 2010 4:35:42 AM org.apache.coyote.http11.Http11Protocol start
> SEVERE: Error starting endpoint
> Address already in use<null>:8081


> LifecycleException:  service.getName(): "Catalina";  Protocol handler
> start failed: Address already in use<null>:8081

As above, same error.

> So, I think the problem is: when shutting down tomcat, the
> Http11Protocol is not shut down but Tomcat tries to start it up anyway
> so the "SEVERE: Error starting point" comes up with the BindException
> that the Address is already in use. So, one of my first ideas was to put
> a sleep in between the and the, and it works when
> calling the script manually (tried it like a hundred times on the test
> server). But I really do not understand why tomcat hasn't started up
> today! Maybe this is also worth knowing: the first two error messages
> also appear in the log when tomcat restarts properly, but for the rest,
> there are no error messages at all.

What does the log indicate when you're shutting down Tomcat?
How long does it take?

Maybe you have a problem that you're not aware of.  A more recent
version of Tomcat may assist you with this, as it contains some
detection that adds messages to the logs when it finds potential
problems during shutdown.

Once you know how long it *should* take to shutdown, under normal
conditions, have a look at the usage statement of
/usr/local/tomcat6/bin/ for some options on forcibly shutting
Tomcat down after a time limit.


> I'm kind of desperate because I really don't know what to do. Might
> there be some problem with the shell script? Or the cron job? Is there a
> known tomcat bug or anything else? I really really hope that someone of
> you is able to help me or point me into a right direction, I'm out of
> ideas and I really don't know what else I can do anymore in order to
> overcome this problem.
> Thank you very much in advance,
> Regards,
> Lara
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message