FAQ

[Tomcat-users] tomcat starting even after port is in use

Sudhir singh rana
Jul 19, 2010 at 7:36 am
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
reply

Search Discussions

5 responses

  • Mark Thomas at Jul 19, 2010 at 4:59 pm

    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
  • Sudhir singh rana at Jul 20, 2010 at 3:25 am
    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 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
  • Caldarale, Charles R at Jul 20, 2010 at 3:48 am

    From: sudhir singh rana
    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
  • Sudhir singh rana at Jul 20, 2010 at 4:14 am
    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 wrote:

    From: sudhir singh rana
    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
  • Caldarale, Charles R at Jul 20, 2010 at 5:07 am

    From: sudhir singh rana
    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

Related Discussions

Discussion Navigation
viewthread | post