Tomcat running under apache/mod-jk hangs after calling HelloWorld servlet exactly 9 times

Discussion in 'Java' started by Guest, Jan 18, 2004.

  1. Guest

    Guest Guest

    Hallo,

    I am preparing the apache/mod-jk/tomcat installation on RedHat 9.
    I use very simple HelloWorld servlet (see later) for testing purposes .
    But I am getting very curious problem: when I call this HelloWorld or even
    some other servlet exactly 9th times (!) the whole tomcat starts to hang
    and it does not return anything after 9th call and it also does not answer
    next requests any more. If I restart tomcat then I have 9 more trials.
    There are no obvious error messages in logs except of mod_jk.log, but
    these errors are probably caused by the hang-up itself. I could supply some
    additional information but I do not know where to look for this error
    exactly.
    May be some load balancing issues but I am not sure.
    Thanks for each helpfull idea.
    Jan Kopinec

    Versions:
    ---------
    RedHat 9 with almost latest patches installed
    Sun JSDK 1.4.2_03-b02
    httpd 2.0.40
    tomcat 4.1.29

    HelloWorld.java:
    -----------------

    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;

    public class HelloWorld extends HttpServlet
    {

    public HelloWorld()
    {
    }

    public void doGet(HttpServletRequest httpservletrequest,
    HttpServletResponse httpservletresponse)
    throws IOException, ServletException
    {
    httpservletresponse.setContentType("text/html");
    PrintWriter printwriter = httpservletresponse.getWriter();
    printwriter.println("Hello World");
    }
    }

    web.xml:
    ---------
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/servlet/HelloWorld</url-pattern>
    </servlet-mapping>
    <servlet>
    <servlet-name>Process</servlet-name>
    <servlet-class>Process</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Process</servlet-name>
    <url-pattern>/servlet/process</url-pattern>
    </servlet-mapping>
    </web-app>

    workers.properties:
    --------------------
    workers.tomcat_home=/usr/local/jakarta-tomcat
    ..java_home=/usr/java/j2sdk1.4.2_03
    ps=/
    worker.list=ajp12, ajp13
    worker.ajp12.port=8007
    worker.ajp12.host=localhost
    worker.ajp12.type=ajp12
    worker.ajp12.lbfactor=1
    worker.ajp13.port=8009
    worker.ajp13.host=localhost
    worker.ajp13.type=ajp13
    worker.ajp13.lbfactor=1
    worker.loadbalancer.type=lb
    worker.loadbalancer.balanced_workers=ajp12, ajp13
    worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
    worker.inprocess.cmd_line=start
    worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)s
    erver$(ps)libjvm.so
    worker.inprocess.stdout=/home/tomcat/logs/stdout_jk.log
    worker.inprocess.stderr=/home/tomcat/logs/stderr_jk.log

    mod_jk.log:
    ------------
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:39:30 2004] [jk_connect.c (233)]: jk_open_socket, connect()
    failed errno = 111
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (757)]: Error connecting to
    tomcat. Tomcat is probably not started or is listenning on the wrong port.
    Failed errno = 111
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1053)]: Error connecting to the
    Tomcat process.
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1420)]: sending request to
    tomcat failed in send loop. err=0
    [Sun Jan 18 14:39:30 2004] [jk_connect.c (233)]: jk_open_socket, connect()
    failed errno = 111
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (757)]: Error connecting to
    tomcat. Tomcat is probably not started or is listenning on the wrong port.
    Failed errno = 111
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1053)]: Error connecting to the
    Tomcat process.
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1420)]: sending request to
    tomcat failed in send loop. err=1
    [Sun Jan 18 14:39:30 2004] [jk_connect.c (233)]: jk_open_socket, connect()
    failed errno = 111
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (757)]: Error connecting to
    tomcat. Tomcat is probably not started or is listenning on the wrong port.
    Failed errno = 111
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1053)]: Error connecting to the
    Tomcat process.
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1420)]: sending request to
    tomcat failed in send loop. err=2
    [Sun Jan 18 14:39:30 2004] [jk_ajp_common.c (1429)]: Error connecting to
    tomcat. Tomcat is probably not started or is listening on the wrong port.
    worker=ajp13 failed errno = 111
    [Sun Jan 18 14:40:35 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:40:38 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:40:40 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:40:41 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:40:42 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:40:44 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
    [Sun Jan 18 14:40:46 2004] [jk_ajp_common.c (1026)]: Error sending request
    try another pooled connection
     
    Guest, Jan 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. the_JAVA_Rookie
    Replies:
    5
    Views:
    10,614
    Mickey Segal
    Aug 19, 2003
  2. circuit_breaker
    Replies:
    2
    Views:
    2,045
    Jack Jia
    Apr 4, 2004
  3. Hari Sekhon
    Replies:
    0
    Views:
    523
    Hari Sekhon
    Jun 20, 2006
  4. ryles
    Replies:
    3
    Views:
    549
    Piet van Oostrum
    Jul 26, 2009
  5. T. Onoma
    Replies:
    9
    Views:
    363
    Dave Thomas
    Dec 15, 2003
Loading...

Share This Page