Java Mailing List Archive

Home » Home (12/2007) » Tomcat Users »

Tomcat 5, Apache2 and mod_jk2 integration problem

Paul Rathbone



I am running RedHat 9 with Tomcat 5.0.16 and Apache 2.0.48 and trying to
get mod_jk2 to work so that I can use apache as the server and just pass
jsp and servlet requests on to tomcat.

In order to get tomcat to auto-generate the apache configuration files I
have had to take tomcat-jk2.jar from the most recent nightly build (to get
ApacheConfig.class) - see bugzilla bug report 25838 and its resolution.

I eventually managed to get mod_jk2 to compile (using configure, make etc
- not ant) and put and into apache/modules directory
(and added the LoadModule to httpd.conf).

Below I have pasted in my server.xml, and files which at least get apache and tomcat to both start
without errors.

My problem is that when I try to open /jsp-examples/ through apache, I get
the following message in the browser : "The servlet container is temporary
unavailable or being upgraded" along with an Internal Error (500), and in
the catalina.out file I get :

Jan 9, 2004 1:53:58 PM
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run
SEVERE: Caught exception (java.lang.NoSuchMethodError:
executing org.apache.jk.common.SocketConnection@(protected)

in the apache error_log file is the following :

[Fri Jan 09 13:53:58 2004] [error] msgAjp.receive(): Bad signature 00
[Fri Jan 09 13:53:58 2004] [error] channelSocket.receive(): Bad header
[Fri Jan 09 13:53:58 2004] [error] workerEnv.processCallbacks() Error
reading reply
[Fri Jan 09 13:53:58 2004] [error] ajp13.service() ajpGetReply recoverable
error 120000

I have turned on as much logging as I can find and the jk2.log from
mod_jk2 doesn't log anything after it has started up.

However, I still have tomcat listening on port 8080 and the /jsp-examples/
works fine through there.

>From the contents of the log files I think mod_jk2 is working OK and
passing the request on to Tomcat, but tomcat is failing to process the
request - have I missed a step somewhere ?

I have experimented with [uri: ...] entries in and
with the <Context > tag in server.xml but haven't succeeded yet - can
anyone help please ?

Thanks for your time.


(Config files all with their comments removed) :


---------------------- :


info=Ajp13 forwarding over socket





<Server port="8005" shutdown="SHUTDOWN" debug="0">


<Listener className="org.apache.jk.config.ApacheConfig"

  <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
  <Resource name="UserDatabase" auth="Container"
    description="User database that can be updated and saved">
  <ResourceParams name="UserDatabase">
<Service name="Catalina">
<Connector port="8080"
         maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         debug="0" connectionTimeout="20000"
         disableUploadTimeout="true" />
  <Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
         protocol="AJP/1.3" />
  <Engine name="Catalina" defaultHost="localhost" debug="0">
   <Logger className="org.apache.catalina.logger.FileLogger"
        prefix="catalina_log." suffix=".log"
   <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
          debug="0" resourceName="UserDatabase"/>
   <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">

    <Listener className="org.apache.jk.config.ApacheConfig"
           modJk="/usr/local/apache/modules/" />
    <Logger className="org.apache.catalina.logger.FileLogger"
          directory="logs" prefix="localhost." suffix=".log"

If you are not the intended recipient please notify the author by
replying to
this email.  Internet communications are not secure and therefore Red
plc does not accept legal responsibility for the contents of this
Although we operate anti-virus programs, Red Squared does not accept
responsibility for any damage that may be caused by viruses being
Any views or opinions presented are solely those of the author and do not
necessarily represent those of Red Squared.
©2008 - Jax Systems, LLC, U.S.A.