I'm pulling my hair out on this one, but I think I've narrowed it down so I can at least ask the question...

We're running Tomcat 4.1.24/Apache 1.3.27/Sun JDK 1.4.2 using mod_jk. The issue we're dealing with now, is that in some cases an existing webapp uses the response.sendRedirect() method to redirect the client to another relative URL. Previously, we were using the warp connector and everything worked fine. Now, using mod_jk, the redirect fails causing the browser to say it can't find the host.

Here's what I've tried so far. I removed Apache from the mix and setup the Coyote HTTP/1.1 connector to listen to port 80. Everything works fine with this setup, so it must be a connector thing, right?

With just the JK connector enabled and listening on 8009, I've added Apache back and setup <Alias> elements in the <Host> element of my server.xml. The host the browser says it can't find is the actual hostname of the machine, not the DNS entry.

I believe this is a problem unique to the jk connector (or how I have it configured) and the response.sendRedirect() method. Here's the documentation from the servlet API:

public void sendRedirect(java.lang.String location)
                  throws java.io.IOException

Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container will convert the relative URL to an absolute URL before sending the response to the client.

If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

Here's the connector and Host element stuff from my server.xml:
...
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" acceptCount="10" debug="0"
               connectionTimeout="0" useURIValidationHack="false"/>
...

<Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">
        <Alias>demo.mycompany.com</Alias>
        <Alias>goatweed</Alias>
        <Alias>demo</Alias>
        <Alias>goatweed.mycompany.com</Alias>
        <Alias>demo.anotherdomain.net</Alias>
        <Alias>goatweed.anotherdomain.net</Alias>
...
</Host>

Anyone have any ideas or see a glaring mistake on my part? I'll gladly provide more info if needed.

Thanks,

Chris Egolf


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to