I have a Tomcat 7.0.57 cluster setup behind an Apache2 using mod_proxy.

Tomcat Node1: ajp:// (http connector also defined on port 8082)
Tomcat Node2: ajp:// (http connector also defined on port 8083)

I have a Java web application (using Jersey, ExtJS and some other goodies), which is deployed using Parallel Deployment. Deployment works fine, and so does calling the application (using the Apache2 as the proxy, meaning http://http_proxy_ip/WebAppContext/app.html). The ExtJS front-end shows up fine.

WEB-INF/web.xml of the application:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <distributable />


<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy balancer://testcluster>
      BalancerMember ajp:// route=acd11-node01
      BalancerMember ajp:// route=acd11-node02
      ProxySet lbmethod=byrequests

    # Excluding balancer-manager app to make it available on master
    ProxyPass /balancer-manager !

    ProxyPass / balancer://testcluster/ stickysession=JSESSIONID|jsessionid
    ProxyPassReverse / balancer://testcluster/ stickysession=JSESSIONID|jsessionid

    <Location /balancer-manager>
      SetHandler balancer-manager

    <Directory "/var/www/html">
      AllowOverride AuthConfig

proxy definition within the ExtJS Model:

proxy : {
        type : 'rest',
        url : '/J_reportScheduler/scheduler/remotehost/scheduler',
        noCache: false,
        reader : {
            type : 'json',
            successProperty : 'success',
            messageProperty : 'message',
        writer : {
            type : 'json',

Servlet definition in Java:

public class FGJobServlet extends HttpServlet {

    public Response createJSON(
            JSONObject json,
            @PathParam("system") String system,
            @PathParam("cleanup") String cleanUp) {
       // logic goes here

So, when the button gets clicked it fires a HTTP Post sending a JSON object to the Java backend using the URL /J_reportScheduler/scheduler/remotehost/scheduler.

When I run this locally from Eclipse, it just runs fine (and it comes back with the URL of the Tomcat instance). Running it in the Cluster gives me the following 404 Not found and coming back with the URL from the HTTP server:

Remote Address:
Request URL:
Request Method:POST
Status Code:404 Not Found
Request Headersview source
Accept-Encoding:gzip, deflate
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Request Payloadview source
{jobname: "ui101", description: "awd", startdate: "2015-01-21T00:00:00",…}
Response Headersview source
Date:Wed, 14 Jan 2015 23:32:56 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.4.6 (CentOS)

Calling the application directly on one of the cluster nodes using the http connector works fine as well. So, I assume this has something to do with my mod_proxy setup.

I've been struggling around with this for 2 days now, and I can't seem to make it work. Any help is much appreciated!

EDIT#1: Yes, I have checked Apache and Tomcat logs, just Apache showing the 404. Application log doesn't show anything as well.

EDIT#2: Just in case it wasn't obvious: HTTP Get requests work just fine.

  • Try remove trailing slash from BalancerMember ajp:// and BalancerMember ajp:// Jan 14, 2015 at 23:48
  • That did the trick! Don't know why I didn't see that! Thanks a lot man! Post it a an answer so I could upvote it! Jan 14, 2015 at 23:53

1 Answer 1


Try remove trailing slash from balancermember:

<Proxy balancer://testcluster>
  BalancerMember ajp:// route=acd11-node01
  BalancerMember ajp:// route=acd11-node02
  ProxySet lbmethod=byrequests

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .