tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashton, Bruce" <bruce.ash...@metoffice.com>
Subject socket error mod_jk Tomcat 4 Apache HP-UX 11
Date Thu, 21 Mar 2002 16:43:49 GMT
Hi all,
	Please CC any replies to bruce.ashton@metoffice.com as I am not sure
that I have successfully signed up to the mailing list.

I have been trying to run Apache 1.3 with Tomcat 4 on HP-UX 11, but
consistently get a socket error, resulting in a '500 internal server error'
at the browser.
As far as I can see the problem is in the function 'jk_open_socket' in the
file jk_connect.c
The code enters a do/while loop at line 114.  It attempts to open a socket;

ret = connect(sock,
                          (struct sockaddr *)addr,
                          sizeof(struct sockaddr_in));

but the variable 'ret' comes back as -1.
the while condition checks that ret == -1 and that EINTR (which is equal to
4) == errno BUT;
errno appears only to be set inside an #ifdef WIN32 macro.  errno is
actually returned as 239 consistently, but I think this might be just a red
herring, as it only seems to appear inside #ifdef WIN32 macros, throughout
the code.  The result is though that loop always drops out.  This function
is called three times for each request in a loop outside jk_open_socket, but
fails each time.  ret is always -1.

I am not a C programmer, or a Unix programmer, so I got a bit lost at this
point.  I am searching the web for possible answers, but any help would be
appreciated.  Is seems unlikely that this bug exists for all non-win32
systems, but perhaps it only fails to connect on HP-UX?  Is there some other
environmental problem?  I've added a few more details below.

Thanks in advance,


	Apache version 1.3.20
	Tomcat version 4.0.2
	HP-UX B.11.00 U 9000/800 167991567 unlimited-user license
	mod_jk.so 
		- built on HP-UX B.11.00 A 9000/785 2014322848 two-user
license
		- from Tomcat 3.3a
		- using gcc 3.0

I set JkLogLevel to 'debug' in my httpd.conf and got  the following  out put
in the JkLogFile;

##########################################################################
[Thu Mar 21 12:04:09 2002]  [jk_uri_worker_map.c (159)]: Into
jk_uri_worker_map_t::uri_worker_map_alloc
[Thu Mar 21 12:04:09 2002]  [jk_uri_worker_map.c (199)]: Into
jk_uri_worker_map_t::uri_worker_map_open
[Thu Mar 21 12:04:09 2002]  [jk_uri_worker_map.c (217)]:
jk_uri_worker_map_t::uri_worker_map_open, rule map size is 0
[Thu Mar 21 12:04:09 2002]  [jk_uri_worker_map.c (324)]:
jk_uri_worker_map_t::uri_worker_map_open, done
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (82)]: Into wc_open
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (207)]: Into build_worker_map,
creating 2 workers
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (213)]: build_worker_map, creating
worker admin
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (138)]: Into wc_create_worker
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (152)]: wc_create_worker, about to
create instance admin of ajp13
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (922)]: Into
ajp13_worker_factory
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (161)]: wc_create_worker, about to
validate and init admin
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (443)]: Into
jk_worker_t::validate
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (456)]: In
jk_worker_t::validate for worker admin contact is wclopweb:8009
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (482)]: Into
jk_worker_t::init
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (177)]: wc_create_worker, done
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (223)]: build_worker_map, removing
old admin worker 
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (213)]: build_worker_map, creating
worker web
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (138)]: Into wc_create_worker
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (152)]: wc_create_worker, about to
create instance web of ajp13
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (922)]: Into
ajp13_worker_factory
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (161)]: wc_create_worker, about to
validate and init web
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (443)]: Into
jk_worker_t::validate
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (456)]: In
jk_worker_t::validate for worker web contact is wclopweb:8008
[Thu Mar 21 12:04:09 2002]  [jk_ajp13_worker.c (482)]: Into
jk_worker_t::init
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (177)]: wc_create_worker, done
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (223)]: build_worker_map, removing
old web worker 
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (235)]: build_worker_map, done
[Thu Mar 21 12:04:09 2002]  [jk_worker.c (102)]: wc_open, done
[Thu Mar 21 12:04:14 2002]  [jk_uri_worker_map.c (159)]: Into
jk_uri_worker_map_t::uri_worker_map_alloc
[Thu Mar 21 12:04:14 2002]  [jk_uri_worker_map.c (199)]: Into
jk_uri_worker_map_t::uri_worker_map_open
[Thu Mar 21 12:04:14 2002]  [jk_uri_worker_map.c (217)]:
jk_uri_worker_map_t::uri_worker_map_open, rule map size is 0
[Thu Mar 21 12:04:14 2002]  [jk_uri_worker_map.c (324)]:
jk_uri_worker_map_t::uri_worker_map_open, done
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (82)]: Into wc_open
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (207)]: Into build_worker_map,
creating 2 workers
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (213)]: build_worker_map, creating
worker admin
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (138)]: Into wc_create_worker
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (152)]: wc_create_worker, about to
create instance admin of ajp13
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (922)]: Into
ajp13_worker_factory
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (161)]: wc_create_worker, about to
validate and init admin
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (443)]: Into
jk_worker_t::validate
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (456)]: In
jk_worker_t::validate for worker admin contact is wclopweb:8009
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (482)]: Into
jk_worker_t::init
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (177)]: wc_create_worker, done
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (223)]: build_worker_map, removing
old admin worker 
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (213)]: build_worker_map, creating
worker web
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (138)]: Into wc_create_worker
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (152)]: wc_create_worker, about to
create instance web of ajp13
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (922)]: Into
ajp13_worker_factory
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (161)]: wc_create_worker, about to
validate and init web
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (443)]: Into
jk_worker_t::validate
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (456)]: In
jk_worker_t::validate for worker web contact is wclopweb:8008
[Thu Mar 21 12:04:14 2002]  [jk_ajp13_worker.c (482)]: Into
jk_worker_t::init
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (177)]: wc_create_worker, done
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (223)]: build_worker_map, removing
old web worker 
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (235)]: build_worker_map, done
[Thu Mar 21 12:04:14 2002]  [jk_worker.c (102)]: wc_open, done
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (351)]: Into
jk_uri_worker_map_t::map_uri_to_worker
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (368)]: Attempting to map
URI '/'
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (456)]:
jk_uri_worker_map_t::map_uri_to_worker, done without a match
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (351)]: Into
jk_uri_worker_map_t::map_uri_to_worker
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (368)]: Attempting to map
URI '/index.html'
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (456)]:
jk_uri_worker_map_t::map_uri_to_worker, done without a match
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (351)]: Into
jk_uri_worker_map_t::map_uri_to_worker
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (368)]: Attempting to map
URI '/index.jsp'
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (416)]:
jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match web -> *.jsp
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (351)]: Into
jk_uri_worker_map_t::map_uri_to_worker
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (368)]: Attempting to map
URI '/index.jsp'
[Thu Mar 21 12:05:12 2002]  [jk_uri_worker_map.c (416)]:
jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match web -> *.jsp
[Thu Mar 21 12:05:12 2002]  [jk_worker.c (123)]: Into wc_get_worker_for_name
web
[Thu Mar 21 12:05:12 2002]  [jk_worker.c (127)]: wc_get_worker_for_name,
done  found a worker
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (865)]: Into
jk_worker_t::get_endpoint
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (775)]: Into
jk_endpoint_t::service
[Thu Mar 21 12:05:12 2002]  [jk_ajp13.c (403)]: Into ajp13_marshal_into_msgb
[Thu Mar 21 12:05:12 2002]  [jk_ajp13.c (537)]: ajp13_marshal_into_msgb -
Done
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (108)]: Into jk_open_socket
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (115)]: jk_open_socket, try to
connect socket = 7
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (124)]: jk_open_socket, after
connect ret = -1
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (143)]: jk_open_socket, connect()
failed errno = 239
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (196)]: In
jk_endpoint_t::connect_to_tomcat, failed errno = 239
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (635)]: Error connecting to
the Tomcat process.
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (848)]: In
jk_endpoint_t::service, send_request failed in send loop 0
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (108)]: Into jk_open_socket
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (115)]: jk_open_socket, try to
connect socket = 7
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (124)]: jk_open_socket, after
connect ret = -1
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (143)]: jk_open_socket, connect()
failed errno = 239
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (196)]: In
jk_endpoint_t::connect_to_tomcat, failed errno = 239
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (635)]: Error connecting to
the Tomcat process.
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (848)]: In
jk_endpoint_t::service, send_request failed in send loop 1
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (108)]: Into jk_open_socket
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (115)]: jk_open_socket, try to
connect socket = 7
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (124)]: jk_open_socket, after
connect ret = -1
[Thu Mar 21 12:05:12 2002]  [jk_connect.c (143)]: jk_open_socket, connect()
failed errno = 239
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (196)]: In
jk_endpoint_t::connect_to_tomcat, failed errno = 239
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (635)]: Error connecting to
the Tomcat process.
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (848)]: In
jk_endpoint_t::service, send_request failed in send loop 2
[Thu Mar 21 12:05:12 2002]  [jk_ajp13_worker.c (549)]: Into
jk_endpoint_t::done

##########################################################################

Here are the relevant parts of httpd.conf;

LoadModule jk_module libexec/mod_jk.so

# mod_jk configuration.
JkWorkersFile "/etc/opt/apache/workers.properties"
JkLogFile "/var/opt/apache/logs/mod_jk.log"
JkLogLevel debug

<VirtualHost _default_:80>
    DocumentRoot /home/httpd/webhtdocs
    ServerName wclopweb
    JkMount /*.jsp web
    JkMount /*.do web
    JkMount /servlet/* web
    JkMount /j_security_check web
    ErrorLog /var/opt/apache/logs/error_log
    CustomLog /var/opt/apache/logs/access_log common
    LogLevel warn
    <Location "/WEB-INF/">
        AllowOverride None
        deny from all
    </Location>
</VirtualHost>

##########################################################################

The relevant parts of workers.properties;

workers.tomcat_home=/opt/tomcat4/dist
workers.java_home=/opt/java1.2
ps=/
worker.list=admin, web

worker.admin.port=8009
worker.admin.host=wclopweb
worker.admin.type=ajp13

worker.web.port=8008
worker.web.host=wclopweb
worker.web.type=ajp13

worker.web.lbfactor=1

##########################################################################

The server.xml file;

<Server port="8005" shutdown="SHUTDOWN" debug="0">

  <!-- Define an Apache-Connector Service -->
  <Service name="Tomcat-Apache">

    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
     port="8008" minProcessors="5" maxProcessors="75"
     enableLookups="true" appBase="webapps"
     acceptCount="10" debug="0"/>

    <!-- Replace "localhost" with what your Apache "ServerName" is set to
-->
    <Engine 
     name="Apache" defaultHost="wclopweb" debug="0">

      <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="apache_log." suffix=".txt"
              timestamp="true"/>

      <Host name="wclopweb" debug="0"
appBase="/home/httpd/tomcatweb/webapps" unpackWARs="false">

        <Context path="" docBase="webroot.war" debug="0" reloadable="false">

          <Logger className="org.apache.catalina.logger.FileLogger"
            prefix="tomcatweb." suffix=".log" timestamp="true"/>

        </Context>

      </Host>

    </Engine>

  </Service>

</Server>

##########################################################################



Bruce Ashton
Java Developer
Product Development Branch
Commercial Division
ext. 4560


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message