I got the asynch servlet working with Apache and mod_jk. The issue turned out to not be with mod_jk. I was deploying to a clustered environment with two tomcats that were set up to do session replication. I installed a third lone tomcat, linked it to apache with mod_jk, and it worked perfectly.

So now I guess my question is somewhat vague, but how would I go about getting asynchronous servlets to work with clustering enabled? The isAsyncSupported() method of the request object returns false in my cluster setup... I've included the cluster element from my server.xml file. I have this between the <host></host> element.

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8">

  <Manager className="org.apache.catalina.ha.session.DeltaManager"
    stateTransferTimeout="10"
    expireSessionsOnShutdown="false"
    notifyListenersOnReplication="true"/>

  <Channel className="org.apache.catalina.tribes.group.GroupChannel">

<Membership className="org.apache.catalina.tribes.membership.McastService"
      address="228.0.0.4"
      port="45564"
      frequency="500"
      dropTime="3000"/>

<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
      address="auto"
      port="4000"
      autoBind="100"
      selectorTimeout="5000"
      maxThreads="6"/>

<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
    </Sender>

<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/> <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>

  </Channel>

<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>
  <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

<ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/> <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

</Cluster>

-S


On 6/6/2011 5:21 PM, ma...@apache.org wrote:
Seth Lenzi<le...@jimmy.harvard.edu>  wrote:


I'm using Tomcat v7.0.14, Apache v2.2.17, and mod_jk v1.2.30.

The Servlet I have does not implement CometProcessor. It's just a
regular HttpServlet which creates an AsyncContext from the
HttpServletRequest object. Like the example Servlet at this page,
http://developerlife.com/tutorials/?p=1437

It does work nicely when accessed directly from Tomcat on port 8080...
Only throws the IllegalStateExeception when going through Apache +
mod_jk. I'm using the default HTTP connector, no NIO API... Since it
was
working through Tomcat I figured I didn't need the NIO HTTP connector.

Thanks for your reply.

-S


On 6/6/2011 4:49 PM, André Warnier wrote:
Seth Lenzi wrote:
Anyone here have any experience with asynchronous servlets under a
Tomcat that's linked to Apache via mod_jk? I have an asynchronous
servlet that's working nicely when accessed directly from Tomcat,
but,
when I access it by going through Apache and mod_jk the
ServletRequest.startAsync() function call throws an
IllegalStateException saying the feature is not supported.

You do not give a clue about which version of Tomcat you are using,
but
this may provide an explanation :
http://tomcat.apache.org/tomcat-7.0-doc/aio.html
Tomcat 7 has passed the Servlet TCK with all possible combinations of protocol 
(HTTP, AJP), connector implementation (BIO, NIO, APR) and httpd module (mod_jk, 
mod_proxy_http, mod_proxy_ajp).

Asynchronous servlets work in all combinations.

The best thing to do is create the simplest possible test case (ie a single 
Servlet) that demonstrates this issue and attach it to a bugzilla issue.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to