I have got Apache 2.2.15 proxying demands to GlassFish 3.1.1 via mod_proxy_ajp while using defaults on Apache and GlassFish. The setup appears to operate okay for any very short time then I'll obtain a thread pool busy error message within the GlassFish log then a timeout error within the Apache log and also the application does not work again until I restart GlassFish.

Must I make configuration changes to avoid this error?

Note: the machine isn't under heavy load - it is only utilized on my own with one browser by moving through pages within the application. This indicates the problem may well be a thread leak bug whether it is not a misconfiguration. The mistake I recieve within the browser is 500: Internal Server Error.

The mistake within the GlassFish log is:


The mistake within the Apache log is:

[error] (70007)The timeout specified has expired: ajp_ilink_receive() can't receive header

My proxy configuration in Apache is:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass / ajp://mydomain:8009/
ProxyPassReverse / ajp://mydomain:8009/

As well as in GlassFish I simply run the next instructions following the install:

asadmin create-http-listener --listenerport 8009 --listeneraddress --defaultvs server apache-proxy
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.apache-proxy.jk-enabled=true

I requested this around the GlassFish forum on java.internet and also got an answer from the effect:

You have to make sure that GlassFish's maximum threads reaches least as much as Apache.

Full Answer here:


This appears just like a reasonable answer so I am posting it for the advantage of others.

Note: one method to set the threads utilized on Apache is by using the max attribute like so:

ProxyPass / ajp://mydomain:8009/ max=20