You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sudhir singh rana <su...@gmail.com> on 2010/07/19 09:35:50 UTC

tomcat starting even after port is in use

Hi,

I started tomcat but tomcat port was in use. Due to this some functionality
of my program was not working. Tomcat gives the error when port is in use
but it comes up. I want tomcat should not come up when port is in use.

Can anyone help me

thanks in advance

RE: tomcat starting even after port is in use

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: sudhir singh rana [mailto:sudhirsinghrana@gmail.com]
> Subject: Re: tomcat starting even after port is in use
> 
> is there any way I can achieve this in 5.5.27

Not via configuration, as far as I know.  You could change the code at lines 501-508 in org/apache/catalina/startup/Catalin.java from this:

        // Start the new server
        if (server instanceof Lifecycle) {
            try {
                server.initialize();
            } catch (LifecycleException e) {
                log.error("Catalina.start", e);
            }
        }

to this:

        // Start the new server
        if (server instanceof Lifecycle) {
            try {
                server.initialize();
            } catch (LifecycleException e) {
                if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE"))
                    throw new java.lang.Error(e);
                else
                    log.error("Catalina.start", e);
            }
        }

to match the updated code in 6.0.x, allowing use of the system property.  Or just upgrade your Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat starting even after port is in use

Posted by sudhir singh rana <su...@gmail.com>.
is there any way I can achieve this in 5.5.27

thanks

On Tue, Jul 20, 2010 at 9:15 AM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: sudhir singh rana [mailto:sudhirsinghrana@gmail.com]
> > Subject: Re: tomcat starting even after port is in use
> >
> > I am using tomcat 5.5.27 and problem is that even tomcat
> > got exception due to port in use it initialized my servlet
> > I mean called init function.
>
> Not sure how to avoid that on Tomcat 5.5.27, but if you could move up to
> 6.0 or 7.0, you can set the following system property to true:
>
> org.apache.catalina.startup.EXIT_ON_INIT_FAILURE
>
> The doc is at the end of this page:
> http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: tomcat starting even after port is in use

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: sudhir singh rana [mailto:sudhirsinghrana@gmail.com]
> Subject: Re: tomcat starting even after port is in use
> 
> I am using tomcat 5.5.27 and problem is that even tomcat 
> got exception due to port in use it initialized my servlet
> I mean called init function.

Not sure how to avoid that on Tomcat 5.5.27, but if you could move up to 6.0 or 7.0, you can set the following system property to true:

org.apache.catalina.startup.EXIT_ON_INIT_FAILURE

The doc is at the end of this page:
http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat starting even after port is in use

Posted by sudhir singh rana <su...@gmail.com>.
I am using tomcat 5.5.27 and problem is that even tomcat got exception due
to port in use it initialized my servlet I mean called init function.

thanks

On Mon, Jul 19, 2010 at 10:29 PM, Mark Thomas <ma...@apache.org> wrote:

> > Hi,
> >
> > I started tomcat but tomcat port was in use. Due to this some
> functionality
> > of my program was not working. Tomcat gives the error when port is in use
> > but it comes up. I want tomcat should not come up when port is in use.
> >
> > Can anyone help me
>
> Yes, but only when you provide some basic information such as exactly
> which Tomcat version you are using.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: tomcat starting even after port is in use

Posted by Mark Thomas <ma...@apache.org>.
On 19/07/2010 08:35, sudhir singh rana wrote:
> Hi,
> 
> I started tomcat but tomcat port was in use. Due to this some functionality
> of my program was not working. Tomcat gives the error when port is in use
> but it comes up. I want tomcat should not come up when port is in use.
> 
> Can anyone help me

Yes, but only when you provide some basic information such as exactly
which Tomcat version you are using.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org