You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Pavan Aripirala Venkata <pv...@h5technologies.com> on 2003/02/18 19:42:56 UTC

Cactus with load balancing in a clustered environment - Exception.

	Hi all,
	I have a clustered environment wherein I have our application
running on three application servers (JBoss 3.0) (on three different
machines), and we have an Apache load balancer (with sticky sessions)
for load balancing these machines. With this setup I run some of my
cactus tests and sometimes the following exception is occurring - the
occurring of this exception is erratic.

2003-02-13 16:36:44,313 WARN  [org.jboss.jbossweb] (Logger.java:167)
WARNING: jva.io.IOException: Premature EOF reading params
2003-02-13 16:36:44,322 WARN  [org.jboss.jbossweb] (Logger.java:167)
WARNING: Eception for /cactus/ServletRedirector/
javax.servlet.ServletException: Missing service name parameter
[ServletTestRediector_Service] in HTTP request.
        at
org.apache.cactus.server.AbstractTestController.getServiceName(AbstrctTe
stController.java:176)
        at
org.apache.cactus.server.AbstractTestController.handleRequest(AbstratTes
tController.java:114)
        at
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedrect
or.java:134)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
and so on

	I don't get this exception when I run the cactus tests with just
one single application server (no Apache in between), i.e., the regular
way. Also I am able to test my application from the web pages with
clustering on, without any exceptions.
  	Looks like the request parameters are not reaching the app
server. You might have seen this if you had just typed 
http://<your host>:<deployport>/cactus/ServletRedirector/ in the web
browser.

	In cactus.properties I set the servletRedirectorURL (or the
contextURL) to the ipaddress of the machine where Apache resides. I use
Java threading (home built code) to run multiple concurrent cactus tests
- I am not using the JUnit's ActiveTestSuite. I also make sure that the
input data is not same for two threads. I am successful with this
threaded setup when there is no clustering.
	JBoss internally uses jetty. I don't know if that causes any
error. Long ago I saw an posting on this list about jetty and cactus
problem - I am sure these two are not related. (FYI the subject of that
e-mail was Re: [jetty-support] Re: Cactus and Jetty problem - sent by
Scott Sayles [ssayles@fgm.com]).
	Please, let me know if anyone knows how to fix it.
Thanks

Pavan.
	


RE: Cactus with load balancing in a clustered environment - Exception.

Posted by Vincent Massol <vm...@octo.com>.
Hi Pavan,

There is one issue with Cactus that will prevent your setup from working
fine. ATM, it is not possible to run multiple concurrent cactus tests.
The reason is simple and easy to fix: each cactus test result is put in
the Servlet Config (application scope) under a fixed key name. Thus a
second test might overwrite the result of a first test before the first
test returns.

The solution is to add some unique ID to each test. The ID should
probably be generated on the Cactus client side, passed to the
redirector as another cactus parameter. The redirector will save the
test result using this id and the client side will issue the request to
get the test result using this id.

There is another potential problem: The cactus client side issues 2
requests to the redirector: once to run the server side tests and
another one to get the test results. ATM, the second HTTP call does NOT
use the same HTTP session as the first HTTP call (actually, it's even
possible that that there is no HTTP session created on the first call).
Thus, with you load balancer, the second call may end up on another
application server instance and thus the test result that will be
returned will not be the correct one.

Thanks
-Vincent
 

> -----Original Message-----
> From: Pavan Aripirala Venkata [mailto:pvenkata@h5technologies.com]
> Sent: 18 February 2003 19:43
> To: cactus-user@jakarta.apache.org
> Subject: Cactus with load balancing in a clustered environment -
> Exception.
> 
> 	Hi all,
> 	I have a clustered environment wherein I have our application
> running on three application servers (JBoss 3.0) (on three different
> machines), and we have an Apache load balancer (with sticky sessions)
> for load balancing these machines. With this setup I run some of my
> cactus tests and sometimes the following exception is occurring - the
> occurring of this exception is erratic.
> 
> 2003-02-13 16:36:44,313 WARN  [org.jboss.jbossweb] (Logger.java:167)
> WARNING: jva.io.IOException: Premature EOF reading params
> 2003-02-13 16:36:44,322 WARN  [org.jboss.jbossweb] (Logger.java:167)
> WARNING: Eception for /cactus/ServletRedirector/
> javax.servlet.ServletException: Missing service name parameter
> [ServletTestRediector_Service] in HTTP request.
>         at
>
org.apache.cactus.server.AbstractTestController.getServiceName(AbstrctTe
> stController.java:176)
>         at
>
org.apache.cactus.server.AbstractTestController.handleRequest(AbstratTes
> tController.java:114)
>         at
>
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedrect
> or.java:134)
>         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> and so on
> 
> 	I don't get this exception when I run the cactus tests with just
> one single application server (no Apache in between), i.e., the
regular
> way. Also I am able to test my application from the web pages with
> clustering on, without any exceptions.
>   	Looks like the request parameters are not reaching the app
> server. You might have seen this if you had just typed
> http://<your host>:<deployport>/cactus/ServletRedirector/ in the web
> browser.
> 
> 	In cactus.properties I set the servletRedirectorURL (or the
> contextURL) to the ipaddress of the machine where Apache resides. I
use
> Java threading (home built code) to run multiple concurrent cactus
tests
> - I am not using the JUnit's ActiveTestSuite. I also make sure that
the
> input data is not same for two threads. I am successful with this
> threaded setup when there is no clustering.
> 	JBoss internally uses jetty. I don't know if that causes any
> error. Long ago I saw an posting on this list about jetty and cactus
> problem - I am sure these two are not related. (FYI the subject of
that
> e-mail was Re: [jetty-support] Re: Cactus and Jetty problem - sent by
> Scott Sayles [ssayles@fgm.com]).
> 	Please, let me know if anyone knows how to fix it.
> Thanks
> 
> Pavan.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org