Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an instance of Tomcat behind an Apache. We use mod_jk.

The module config is:

LoadModule jk_module modules/
<IfModule mod_jk.c>
  JkWorkersFile conf/
  JkLogFile     logs/mod_jk.log
  JkLogLevel    info
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

And here the VirtualHost config:

<VirtualHost *:9090>
  JkMount  /Web/* worker-Web
  JkMount  /Web worker-Web

The file:


This config works great for jsp, html... but we have a JNLP file:

<?xml version="1.0" encoding="utf-8"?>
  <jnlp spec="1.0" codebase="$$codebase">
      <title>Gestor Impresiones</title>
    <resources locale="es">
      <jar href="gestorImpresiones.jar"/>
      <jar href="jasperreports-1.2.5.jar"/>
      <jar href="commons-httpclient-3.1-beta1.jar"/>
      <jar href="commons-logging-1.1.jar"/>
      <jar href="commons-codec-1.3.jar"/>
      <jar href="commons-javaflow-20060411.jar"/>
      <jar href="commons-collections-3.1.jar"/>
      <jar href="poi-3.0.1-FINAL-20070705.jar"/>
      <jar href="jdic.jar"/>
    <resources os="Windows">
      <jar href="windows/jdic_stub.jar"/>
      <nativelib href="windows/jdic-native.jar"/>
    <resources os="Linux">
      <jar href="linux/jdic_stub.jar"/>
      <nativelib href="linux/jdic-native.jar"/>
    <resources locale="es">
      <j2se version="1.3+" href=""/>
    <application-desc main-class="stacks.printing.cliente.GestorImpresionLauncher"/>

The problem is that downloading the JNLP resources fails randomly (It fails more if the connection speed are poor).

If we access directly to Tomcat, everything works fine.

Any ideas?

Edited 1:

Apache log error:

[Thu Jul 01 09:51:45 2010] [868:5096] [info] jk_connect.c (566): connect to failed (errno=61)
[Thu Jul 01 09:51:45 2010] [868:5096] [info] jk_ajp_common.c (869): Failed opening socket to ( (errno=61)
[Thu Jul 01 09:51:45 2010] [868:5096] [error] jk_ajp_common.c (1359): (worker-omiapWeb) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=61)
[Thu Jul 01 09:51:45 2010] [868:5096] [info] jk_ajp_common.c (2186): (worker-omiapWeb) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Thu Jul 01 09:51:45 2010] [868:5096] [error] jk_ajp_common.c (2204): (worker-omiapWeb) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
[Thu Jul 01 09:51:45 2010] [868:5096] [info] mod_jk.c (2364): Service error=-3 for worker=worker-omiapWeb

Edited 2:

server.xml AJP section:

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8209" 
       maxThreads="300" connectionTimeout="600000"
       enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
share|improve this question
What versions of Tomcat, Apache, and connector modules are you using? – Kief Jul 12 '10 at 7:54
Tomcat 5.5.27, Apache HTTP 2.0.63 and Tomcat Connector 1.2.26 – Maxfer Jul 12 '10 at 11:17

Try setting your worker timeouts to higher than default values:





That goes in your file. You may have to go higher with one or more of them - we'd need to see your apache log files to be sure which one is causing the issue for you.

share|improve this answer
I already tried to change the default settings without any results. – Maxfer Jul 12 '10 at 7:32

Why do you serve the JNLP application from tomcat? WebStart uses plain HTTP GET requests to acces the JNLP file and then the .jar files. You could place these outside of Tomcat, and let Apache do the work alone.

share|improve this answer

You may also want to post the bits of your server.xml for the AJP connector. One possibility is that your connector on the Tomcat side doesn't have enough capacity (maxThreads & timeout) to handle the number of connections Apache is sending it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.