You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roger Vaughn <rv...@seaconinc.com> on 2000/03/29 15:13:04 UTC

Cocoon/Tomcat configuration question

I'm trying to set up Tomcat to serve Cocoon, and I'm having a bit of trouble
with it.  I have done this on JRun, but the Tomcat configuration
complexities are giving me headaches.

I can get the basic servlet running fine, so that http://myhost/Cocoon.xml
works perfectly.  The problem I'm having is serving .xml files out of my web
server space.  Tomcat seems to want to handle any request handed to it
completely within its own space.

For example, I have an index.xml in my web server's doc root.  I have
everything set up correctly so that a request for this gets handed to
Tomcat.  But then I get a file not found exception from Cocoon, which is
looking for the path ..../webapps/ROOT/index.xml - which is in the Tomcat
space!  Is there any way I can configure Tomcat to serve these files from my
web server's space?

Thanks.


Re: Cocoon/Tomcat configuration question

Posted by "Hitesh Kr. Seth" <hi...@seranova.com>.
Greetings

I have got Tomcat 3.1M1 to work fine with Cocoon 1.7.
(Windows NT 4.0 Server, Service Pack 6)

(I had problems with XSP pages with Tomcat 3.0, which
was pointed to me as a a known issue.)

Here are the changes to the Tomcat configuration files
which I have made to get Tomcat 3.1 work with Cocoon 1.7.

{modify your directories etc as appropiate}

To G:\tomcat\webapps\ROOT\WEB-INF\web.xml add the following
(between the <web-app> & </web-app> tags)

<servlet>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
  <init-param>
   <param-name>properties</param-name>
   <param-value>E:/Cocoon/conf/cocoon.properties</param-value>
  </init-param>
 </servlet>
 <servlet-mapping>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <url-pattern>*.xml</url-pattern>
 </servlet-mapping>

and made sure that the jars are in the
G:\Tomcat\bin\tomcat.bat  file. (Notice, I copied some jars
from the Cocoon distribution to the %TOMCAT_HOME%\lib
directory. You might want to keep them in the Cocoon distribution
and point to the classpath appropiately)

set CLASSPATH=.
set CLASSPATH=%TOMCAT_HOME%\classes
set CLASSPATH=%CLASSPATH%;E:\Xalan\Xerces.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jndi.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
set CLASSPATH=%CLASSPATH%;E:\Xalan\Xalan.jar

Best Regards

Hitesh.

----- Original Message -----
From: Roger Vaughn <rv...@seaconinc.com>
To: Tomcat Users <to...@jakarta.apache.org>; Cocoon Users
<co...@xml.apache.org>
Sent: Wednesday, March 29, 2000 8:13 AM
Subject: Cocoon/Tomcat configuration question


> I'm trying to set up Tomcat to serve Cocoon, and I'm having a bit of
trouble
> with it.  I have done this on JRun, but the Tomcat configuration
> complexities are giving me headaches.
>
> I can get the basic servlet running fine, so that http://myhost/Cocoon.xml
> works perfectly.  The problem I'm having is serving .xml files out of my
web
> server space.  Tomcat seems to want to handle any request handed to it
> completely within its own space.
>
> For example, I have an index.xml in my web server's doc root.  I have
> everything set up correctly so that a request for this gets handed to
> Tomcat.  But then I get a file not found exception from Cocoon, which is
> looking for the path ..../webapps/ROOT/index.xml - which is in the Tomcat
> space!  Is there any way I can configure Tomcat to serve these files from
my
> web server's space?
>
> Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: Cocoon/Tomcat configuration question

Posted by "Hitesh Kr. Seth" <hi...@seranova.com>.
Greetings

I have got Tomcat 3.1M1 to work fine with Cocoon 1.7.
(Windows NT 4.0 Server, Service Pack 6)

(I had problems with XSP pages with Tomcat 3.0, which
was pointed to me as a a known issue.)

Here are the changes to the Tomcat configuration files
which I have made to get Tomcat 3.1 work with Cocoon 1.7.

{modify your directories etc as appropiate}

To G:\tomcat\webapps\ROOT\WEB-INF\web.xml add the following
(between the <web-app> & </web-app> tags)

<servlet>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
  <init-param>
   <param-name>properties</param-name>
   <param-value>E:/Cocoon/conf/cocoon.properties</param-value>
  </init-param>
 </servlet>
 <servlet-mapping>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <url-pattern>*.xml</url-pattern>
 </servlet-mapping>

and made sure that the jars are in the
G:\Tomcat\bin\tomcat.bat  file. (Notice, I copied some jars
from the Cocoon distribution to the %TOMCAT_HOME%\lib
directory. You might want to keep them in the Cocoon distribution
and point to the classpath appropiately)

set CLASSPATH=.
set CLASSPATH=%TOMCAT_HOME%\classes
set CLASSPATH=%CLASSPATH%;E:\Xalan\Xerces.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jndi.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
set CLASSPATH=%CLASSPATH%;E:\Xalan\Xalan.jar

Best Regards

Hitesh.

----- Original Message -----
From: Roger Vaughn <rv...@seaconinc.com>
To: Tomcat Users <to...@jakarta.apache.org>; Cocoon Users
<co...@xml.apache.org>
Sent: Wednesday, March 29, 2000 8:13 AM
Subject: Cocoon/Tomcat configuration question


> I'm trying to set up Tomcat to serve Cocoon, and I'm having a bit of
trouble
> with it.  I have done this on JRun, but the Tomcat configuration
> complexities are giving me headaches.
>
> I can get the basic servlet running fine, so that http://myhost/Cocoon.xml
> works perfectly.  The problem I'm having is serving .xml files out of my
web
> server space.  Tomcat seems to want to handle any request handed to it
> completely within its own space.
>
> For example, I have an index.xml in my web server's doc root.  I have
> everything set up correctly so that a request for this gets handed to
> Tomcat.  But then I get a file not found exception from Cocoon, which is
> looking for the path ..../webapps/ROOT/index.xml - which is in the Tomcat
> space!  Is there any way I can configure Tomcat to serve these files from
my
> web server's space?
>
> Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


RE: Cocoon/Tomcat configuration question

Posted by Roger Vaughn <rv...@seaconinc.com>.
Yeah, this is what I have more or less.  (I used the full classpath in
servlet-name and a full absolute path in the param-value for properties.

Let me try to clarify.  The setup works --- sort of.  My *.xml files get
passed to Cocoon, but it appears the Tomcat is rewriting the path on the
way.  To get specific, I browse to http://myserver/index.xml.  This
translates to the file /home/httpd/html/index.xml.  But Cocoon throws a
FileNotFoundException while trying to open the file
/usr/local/tomcat/webapps/ROOT/index.xml.  In other words, the request is
getting passed to Cocoon, but Tomcat appears to be rewriting the path to
point to its directories instead of the original web server dirs.  I'm
fairly confident this isn't a Cocoon problem since I have also run it in
JRun (mostly) successfully.

I could put everything into webapps/ROOT, but that doesn't seem an ideal
solution.

Any other suggestions?

Thanks so far....

-----Original Message-----
From: Mike Engelhart [mailto:mengelhart@earthtrip.com]
Sent: Wednesday, March 29, 2000 10:29 AM
To: cocoon-users@xml.apache.org
Subject: Re: Cocoon/Tomcat configuration question


Roger Vaughn wrote:

> I'm trying to set up Tomcat to serve Cocoon, and I'm having a bit of
trouble
> with it.  I have done this on JRun, but the Tomcat configuration
> complexities are giving me headaches.
>
> I can get the basic servlet running fine, so that http://myhost/Cocoon.xml
> works perfectly.  The problem I'm having is serving .xml files out of my
web
> server space.  Tomcat seems to want to handle any request handed to it
> completely within its own space.
>
> For example, I have an index.xml in my web server's doc root.  I have
> everything set up correctly so that a request for this gets handed to
> Tomcat.  But then I get a file not found exception from Cocoon, which is
> looking for the path ..../webapps/ROOT/index.xml - which is in the Tomcat
> space!  Is there any way I can configure Tomcat to serve these files from
my
> web server's space?
>
> Thanks.
>
what does your web.xml file look like?  Tomcat shouldn't be handling the
.xml documents per se, .xml should be mapped to Cocoon so that it's passed
to the Cocoon servlet for processing.  You need this in your web.xml file
for your webapp:

    <servlet>
        <servlet-name>
            cocoon
        </servlet-name>
        <servlet-class>
            org.apache.cocoon.Cocoon
        </servlet-class>
        <init-param>
            <param-name>
                properties
            </param-name>
            <param-value>
                cocoon.properties
            </param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>
            cocoon
        </servlet-name>
        <url-pattern>
            *.xml
        </url-pattern>
    </servlet-mapping>

Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org



Re: Cocoon/Tomcat configuration question

Posted by Mike Engelhart <me...@earthtrip.com>.
Roger Vaughn wrote:

> I'm trying to set up Tomcat to serve Cocoon, and I'm having a bit of trouble
> with it.  I have done this on JRun, but the Tomcat configuration
> complexities are giving me headaches.
> 
> I can get the basic servlet running fine, so that http://myhost/Cocoon.xml
> works perfectly.  The problem I'm having is serving .xml files out of my web
> server space.  Tomcat seems to want to handle any request handed to it
> completely within its own space.
> 
> For example, I have an index.xml in my web server's doc root.  I have
> everything set up correctly so that a request for this gets handed to
> Tomcat.  But then I get a file not found exception from Cocoon, which is
> looking for the path ..../webapps/ROOT/index.xml - which is in the Tomcat
> space!  Is there any way I can configure Tomcat to serve these files from my
> web server's space?
> 
> Thanks.
> 
what does your web.xml file look like?  Tomcat shouldn't be handling the
.xml documents per se, .xml should be mapped to Cocoon so that it's passed
to the Cocoon servlet for processing.  You need this in your web.xml file
for your webapp:

    <servlet>
        <servlet-name>
            cocoon
        </servlet-name>
        <servlet-class>
            org.apache.cocoon.Cocoon
        </servlet-class>
        <init-param>
            <param-name>
                properties
            </param-name>
            <param-value>
                cocoon.properties
            </param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>
            cocoon
        </servlet-name>
        <url-pattern>
            *.xml
        </url-pattern>
    </servlet-mapping>

Mike