You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Je...@VerizonWireless.com on 2003/03/31 18:10:04 UTC

Problems with ajp13, mod_jk, and load balancer

Hi,
 
I'm having problems getting ajp13 working reliably with mod_jk and the load
balancer.  Here is my configuration:
 
- Linux machines with Red Hat 7.2
- Apache 1.3.27
- Tomcat 4.1.x 
- JDK 1.4.0_01 
- Running Apache AXIS web-services
 
I have setup the workers.properties file to load balance between two Tomcat
nodes.  Everything works fine until one of the Tomcat nodes is brought down.
At this time, the XML that is received by the remaining Tomcat node
(configured to process SOAP message via AXIS servlet) has an invalid
character in the XML's document root.  The actual exception is:
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xfa) was
found in the prolog of the document.  When both nodes are up, SOAP requests
are forwarded to the two Tomcat nodes in a round-robin fashion.  The content
of the valid SOAP message is as follows:
 
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body>
<ns1:getFailures
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:NaagSchema"/> </soapenv:Body></soapenv:Envelope>
 
When the one node is brought down, I see in the mod_jk.log file that the
request failed delivery to the down node and is being routed to the
remaining worker.  When this occurs, the content of the SOAP message is
corrupted and is as follows:
 
รบ?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body>
<ns1:getFailures
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:NaagSchema"/> </soapenv:Body></soapenv:Envelope>
 
You can see that the first character is trashed!
 
Here is what is in the mod_jk.log file during this ordeal:
 
[Mon Mar 31 09:11:00 2003]  [jk_uri_worker_map.c (460)]: Into
jk_uri_worker_map_t::map_uri_to_worker
[Mon Mar 31 09:11:00 2003]  [jk_uri_worker_map.c (477)]: Attempting to map
URI '/naag/services/NaagPort'
[Mon Mar 31 09:11:00 2003]  [jk_uri_worker_map.c (502)]:
jk_uri_worker_map_t::map_uri_to_worker, Found a context match naag_balancer
-> /naag/services/
[Mon Mar 31 09:11:00 2003]  [jk_worker.c (132)]: Into wc_get_worker_for_name
naag_balancer
[Mon Mar 31 09:11:00 2003]  [jk_worker.c (136)]: wc_get_worker_for_name,
done  found a worker
[Mon Mar 31 09:11:00 2003]  [jk_lb_worker.c (527)]: Into
jk_worker_t::get_endpoint
[Mon Mar 31 09:11:00 2003]  [jk_lb_worker.c (310)]: Into
jk_endpoint_t::service
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (1355)]: Into
jk_worker_t::get_endpoint
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (1079)]: Into
jk_endpoint_t::service
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (280)]: Into
ajp_marshal_into_msgb
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (413)]: ajp_marshal_into_msgb -
Done
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #297
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (854)]: ajp_send_request 2:
request body to send 381 - request body to resend 0
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #387
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (652)]:
ajp_connection_tcp_get_message: Error - jk_tcp_socket_recvfull failed
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (1013)]: Error reading reply
[Mon Mar 31 09:11:00 2003]  [jk_ajp_common.c (1150)]: In
jk_endpoint_t::service, ajp_get_reply failed in send loop 0
[Mon Mar 31 09:11:00 2003]  [jk_connect.c (116)]: Into jk_open_socket
[Mon Mar 31 09:11:00 2003]  [jk_connect.c (123)]: jk_open_socket, try to
connect socket = 6
[Mon Mar 31 09:11:03 2003]  [jk_connect.c (132)]: jk_open_socket, after
connect ret = -1
[Mon Mar 31 09:11:03 2003]  [jk_connect.c (151)]: jk_open_socket, connect()
failed errno = 111
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (599)]: In
jk_endpoint_t::ajp_connect_to_endpoint, failed errno = 111
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (844)]: Error connecting to the
Tomcat process.
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (1153)]: In
jk_endpoint_t::service, ajp_send_request failed in send loop 1
[Mon Mar 31 09:11:03 2003]  [jk_connect.c (116)]: Into jk_open_socket
[Mon Mar 31 09:11:03 2003]  [jk_connect.c (123)]: jk_open_socket, try to
connect socket = 6
[Mon Mar 31 09:11:03 2003]  [jk_connect.c (132)]: jk_open_socket, after
connect ret = -1
[Mon Mar 31 09:11:03 2003]  [jk_connect.c (151)]: jk_open_socket, connect()
failed errno = 111
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (599)]: In
jk_endpoint_t::ajp_connect_to_endpoint, failed errno = 111
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (844)]: Error connecting to the
Tomcat process.
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (1153)]: In
jk_endpoint_t::service, ajp_send_request failed in send loop 2
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (1339)]: Into
jk_endpoint_t::done, closing connection 0
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (536)]: In
jk_endpoint_t::ajp_close_endpoint
[Mon Mar 31 09:11:03 2003]  [jk_lb_worker.c (369)]: In
jk_endpoint_t::service, recoverable error... will try to recover on other
host
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (1355)]: Into
jk_worker_t::get_endpoint
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (1079)]: Into
jk_endpoint_t::service
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (280)]: Into
ajp_marshal_into_msgb
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (413)]: ajp_marshal_into_msgb -
Done
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #297
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (854)]: ajp_send_request 2:
request body to send 381 - request body to resend 0
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #4
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13 #3
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #4
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13 #3
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #4
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13 #3
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #4
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13 #3
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (613)]: sending to ajp13 #4
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13 #57
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (462)]: ajp_unmarshal_response:
status = 500
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (467)]: ajp_unmarshal_response:
Number of headers is = 1
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (507)]: ajp_unmarshal_response:
Header[0] [Content-Type] = [text/xml; charset=utf-8]
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13
#519
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (699)]: received from ajp13 #2
[Mon Mar 31 09:11:03 2003]  [jk_ajp_common.c (1333)]: Into
jk_endpoint_t::done, recycling connection
[Mon Mar 31 09:11:03 2003]  [jk_lb_worker.c (389)]: Into jk_endpoint_t::done
 
Has anyone seen this problem before?  Any help would be greatly appreciated.
 
Regards,
 
Jeff
 
Jeff Edwards
Verizon Wireless
2110 Walnut Hill, Ste 260
Irving, TX 75038
(817) 258-1815