You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jed <ne...@gmail.com> on 2008/04/10 10:37:44 UTC

Tomcat passing requests to cocoon for docroot, but not sub-directories?

Hi All,

I'm a new Cocoon user and I've come across and I'm having a really
bizarre problem at the moment which has stopped my site development in
it's tracks.

I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
Cocoon samples running just fine. I've set-up a virtual server with
it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
test and again, those work both fine.

However, I've now started setting up my pipelines/matchers and a
really strange thing is happening.

As a test, I've put "helloworld.xml" and its associated xsl file in
docroot and set-up a matcher so that and request for /*.jhtml
effectively loads and transforms that file. This works fine. However,
if I then make a subdirectory of docroot and place the same xml/xsl
there and set-up a matcher for that, absolutely nothing happens.
Instead I just get a Tomcat 404 page.

I've been scratching my head over this for a week and what appears to
be the problem is that Tomcat is definately passing requests for
documents in docroot to cocoon but NOT for any sub-directories.

The way I tested was as follows:

Test 1:

Created files:
docroot/helloworld.xml
docroot/helloworld.xsl

Matcher:
<map:match pattern="*.jhtml">
<map:generate src="helloworld.xml"/>
<map:transform src="helloworld.xsl"/>
<map:serialize type="html"/>
</map:match>

Request:
http://test.domain/randomfilename.jhtml

Result:
"Hello World!"

Test 2:

Create files:
docroot/main/helloworld.xml
docroot/main/helloworld.xsl

Matcher:
<map:match pattern="/main/*.jhtml">
<map:generate src="/main/helloworld.xml"/>
<map:transform src="/main/helloworld.xsl"/>
<map:serialize type="html"/>
</map:match>

Request:
http://test.domain/main/randomfilename.jhtml

Result:
Tomcat 404 error message

Test 3:

Remove files:
docroot/helloworld.xml
docroot/helloworld.xsl

Matcher:
<map:match pattern="*.jhtml">
<map:generate src="helloworld.xml"/>
<map:transform src="helloworld.xsl"/>
<map:serialize type="html"/>
</map:match>

Request:
http://test.domain/randomfilename.jhtml

Result:
Coccon 404 error message as defined in <map:handle-errors>

I have DEBUG level set in logkit and watched what was happening when I
made requests. mod_jk was intercepting the request from apache and
matching it with a worker and passing it to Tomcat. For requests for
documents in docroot, Tomcat was passing them to cocoon as the
requests and processing can be seen in the sitemap.log file.

However, when a request is made for a file in a sub-directory of
docroot, there is zero activity in sitemap.log - the request just
never gets there!

I am *completely* baffled. I believe I have the various components
configured correctly but as stated, Tomcat will not pass requests for
sub-dirs to Cocoon.

Can anyone shed any light on this?

- Jed

Heres the pertinent extracts from the various configs:

Apache - http.conf:

<VirtualHost *:80>
DocumentRoot /usr/local/apache/share/saab_current/htdocs/
ServerName test.domain
Options FollowSymLinks +Indexes
<Directory /usr/local/apache/share/htdocs>
Options +Indexes
</Directory>
DirectoryIndex index.jhtml index.html index.xml
JkMount /*.shtml xmlworker
JkMount /main/*.jhtml xmlworker
</VirtualHost>

Tomcat - server.xml
<Engine name="Catalina" defaultHost="test.domain"
cachingAllowed="true" debug="9">
<Host name="test.domain" debug="9" appBase="/usr/local/apache/share/htdocs"
unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false">
<Context debug="9"
reloadable="true"
path=""
docBase="/usr/local/apache/share/htdocs"
/>
</Host>
</Engine>

Tomcat - workers.properties

# XML worker
worker.xmlworker.port=8009
worker.xmlworker.host=localhost
worker.xmlworker.type=ajp13

Cocoon - sitemap.xmap

<map:match pattern="*.jhtml">
<map:generate src="pageOne.xml"/>
<map:transform src="doc2html.xsl"/>
<map:serialize type="html"/>
</map:match>

<map:match pattern="/main/*.jhtml">
<map:generate src="/main/pageTwo.xml"/>
<map:transform src="/main/doc2html.xsl"/>
<map:serialize type="html"/>
</map:match>

My set-up is:

Fedora Core 6
Apache/2.2.8
mod_jk 1.2.26
Tomcat  5.5.26
Cocoon 2.1.11
Sun JDK 1.6.0_05-b13

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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by "Lehtonen, Mika" <mi...@digikartta.net>.
How about if you test something like:

<map:match pattern="main/*.jhtml">
<map:generate src="helloworld.xml"/>
<map:transform src="helloworld.xsl"/>
<map:serialize type="html"/>
</map:match>

or

<map:match pattern="**.jhtml">
<map:generate src="helloworld.xml"/>
<map:transform src="helloworld.xsl"/>
<map:serialize type="html"/>
</map:match>

and then try

http://test.domain/main/randomfilename.jhtml


mika



Jed kirjoitti:
> Have done all of those things already.
>
> - Jed
>
> On 10/04/2008, Lehtonen, Mika <mi...@digikartta.net> wrote:
>   
>> Hi,
>>
>>  can't you just leave the mod_jk out of this for now on and test directly
>> with Tomcat e.g. configure it to listen port 8080. Another approach might be
>> to leave Cocoon out and test some static material through mod_jk. That way
>> you can assure that it is working properly.
>>     


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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jed <je...@wunderboy.org>.
Have done all of those things already.

- Jed

On 10/04/2008, Lehtonen, Mika <mi...@digikartta.net> wrote:
> Hi,
>
>  can't you just leave the mod_jk out of this for now on and test directly
> with Tomcat e.g. configure it to listen port 8080. Another approach might be
> to leave Cocoon out and test some static material through mod_jk. That way
> you can assure that it is working properly.
>
>  mika
>
>  Jed kirjoitti:
>
>
> > I know mod_jk is working because it's passing the request through to
> > Tomcat. Instead of trying to serve the *.jhtml file from Apache, it's
> > going to Tomcat which is then passing back it's *own* 404 message
> > rather than the default apache version.
> >
> > I've got mod_jk in debug mod and looked at the output and its
> > definately passing the request to Tomcat.
> >
> > - Jed
> >
> > On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
> >
> >
> > > Well then it must be your mod_jk configuration. I do not have a lot of
> > > experience with that, since I normally use mod_rewrite or mod_proxy.
> > >
> > >  On the cocoon side the correct way to go is without the preceding "/",
> so
> > >
> > >  <map:match pattern="/main/*.jhtml">
> > >  <map:generate src="/main/pageTwo.xml"/>
> > >
> > >  Should be
> > >
> > >  <map:match pattern="main/*.jhtml">
> > >  <map:generate src="main/pageTwo.xml"/>
> > >
> > >  So somehow tomcat or apache does not know how to handle requests with
> /main
> > > in front? You do not by accident have another context running inside
> your
> > > tomcat that has the name main?
> > >
> > >  Gr.
> > >
> > >  Jeroen
> > >
> > >
> > >  Jed wrote:
> > >
> > >
> > >
> > > > Hi Jeroen,
> > > >
> > > > Thanks for the suggestion. I did actually try that but it didn't solve
> it.
> > > >
> > > >
> > > :(
> > >
> > >
> > > > The problem is that Tomcat still appears to NOT be passing any request
> > > > for a *.jhtml document in the docroot/main folder to cocoon.
> > > >
> > > > As I said, when I ask for http://test.domain/test.jhtml cocoon
> > > > recieves the request and processes it as seen in the sitemap.log file.
> > > >
> > > > However asking for http://test.domain/main/test.jhtml
> > > >
> > > >
> > > never gets past
> > >
> > >
> > > > Tomcat. It never passes it to cocoon so it never matches a matcher and
> > > > no request is ever seen in the sitemap.log. I just get a 404 from
> > > > Tomcat as it's trying to return an actual file called "test.jhtml" :(
> > > >
> > > > - Jed
> > > >
> > > > On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
> > > >
> > > >
> > > >
> > > > > Yes you are correct here. Remove the "/" from the beginning. Also
> use a
> > > > > relative source:
> > > > >
> > > > >  Use
> > > > >  <map:generate src="main/helloworld.xml"/>
> > > > >
> > > > >  instead of
> > > > >
> > > > >  <map:generate src="/main/helloworld.xml"/>
> > > > >
> > > > >  Regards,
> > > > >
> > > > >  Jeroen
> > > > >
> > > > >
> > > > >
> > > > >  Rainer Pruy wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Hi Jed,
> > > > > >
> > > > > > you might try using <map:match pattern="main/*.jhtml"> (leaving
> out
> > > > > >
> > > > > >
> > > > >
> > > >
> > > the
> > >
> > >
> > > >
> > > > > "/").
> > > > >
> > > > >
> > > > >
> > > > > > I remember having experienced similar problem some tim ago.
> > > > > >
> > > > > > Regards
> > > > > > Rainer
> > > > > >
> > > > > > Jed schrieb:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I'm a new Cocoon user and I've come across and I'm having a
> really
> > > > > > > bizarre problem at the moment which has stopped my site
> development
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > in
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > it's tracks.
> > > > > > >
> > > > > > > I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
> > > > > > > Cocoon samples running just fine. I've set-up a virtual server
> with
> > > > > > > it's own docroot and made a simple "HelloWorld" servlet and
> XML/XSLT
> > > > > > > test and again, those work both fine.
> > > > > > >
> > > > > > > However, I've now started setting up my pipelines/matchers and a
> > > > > > > really strange thing is happening.
> > > > > > >
> > > > > > > As a test, I've put "helloworld.xml" and its associated xsl file
> in
> > > > > > > docroot and set-up a matcher so that and request for /*.jhtml
> > > > > > > effectively loads and transforms that file. This works fine.
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > However,
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > if I then make a subdirectory of docroot and place the same
> xml/xsl
> > > > > > > there and set-up a matcher for that, absolutely nothing happens.
> > > > > > > Instead I just get a Tomcat 404 page.
> > > > > > >
> > > > > > > I've been scratching my head over this for a week and what
> appears
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > to
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > be the problem is that Tomcat is definately passing requests for
> > > > > > > documents in docroot to cocoon but NOT for any sub-directories.
> > > > > > >
> > > > > > > The way I tested was as follows:
> > > > > > >
> > > > > > > Test 1:
> > > > > > >
> > > > > > > Created files:
> > > > > > > docroot/helloworld.xml
> > > > > > > docroot/helloworld.xsl
> > > > > > >
> > > > > > > Matcher:
> > > > > > > <map:match pattern="*.jhtml">
> > > > > > > <map:generate src="helloworld.xml"/>
> > > > > > > <map:transform src="helloworld.xsl"/>
> > > > > > > <map:serialize type="html"/>
> > > > > > > </map:match>
> > > > > > >
> > > > > > > Request:
> > > > > > > http://test.domain/randomfilename.jhtml
> > > > > > >
> > > > > > > Result:
> > > > > > > "Hello World!"
> > > > > > >
> > > > > > > Test 2:
> > > > > > >
> > > > > > > Create files:
> > > > > > > docroot/main/helloworld.xml
> > > > > > > docroot/main/helloworld.xsl
> > > > > > >
> > > > > > > Matcher:
> > > > > > > <map:match pattern="/main/*.jhtml">
> > > > > > > <map:generate src="/main/helloworld.xml"/>
> > > > > > > <map:transform src="/main/helloworld.xsl"/>
> > > > > > > <map:serialize type="html"/>
> > > > > > > </map:match>
> > > > > > >
> > > > > > > Request:
> > > > > > > http://test.domain/main/randomfilename.jhtml
> > > > > > >
> > > > > > > Result:
> > > > > > > Tomcat 404 error message
> > > > > > >
> > > > > > > Test 3:
> > > > > > >
> > > > > > > Remove files:
> > > > > > > docroot/helloworld.xml
> > > > > > > docroot/helloworld.xsl
> > > > > > >
> > > > > > > Matcher:
> > > > > > > <map:match pattern="*.jhtml">
> > > > > > > <map:generate src="helloworld.xml"/>
> > > > > > > <map:transform src="helloworld.xsl"/>
> > > > > > > <map:serialize type="html"/>
> > > > > > > </map:match>
> > > > > > >
> > > > > > > Request:
> > > > > > > http://test.domain/randomfilename.jhtml
> > > > > > >
> > > > > > > Result:
> > > > > > > Coccon 404 error message as defined in <map:handle-errors>
> > > > > > >
> > > > > > > I have DEBUG level set in logkit and watched what was happening
> when
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > I
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > made requests. mod_jk was intercepting the request from apache
> and
> > > > > > > matching it with a worker and passing it to Tomcat. For requests
> for
> > > > > > > documents in docroot, Tomcat was passing them to cocoon as the
> > > > > > > requests and processing can be seen in the sitemap.log file.
> > > > > > >
> > > > > > > However, when a request is made for a file in a sub-directory of
> > > > > > > docroot, there is zero activity in sitemap.log - the request
> just
> > > > > > > never gets there!
> > > > > > >
> > > > > > > I am *completely* baffled. I believe I have the various
> components
> > > > > > > configured correctly but as stated, Tomcat will not pass
> requests
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > for
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > sub-dirs to Cocoon.
> > > > > > >
> > > > > > > Can anyone shed any light on this?
> > > > > > >
> > > > > > > - Jed
> > > > > > >
> > > > > > > Heres the pertinent extracts from the various configs:
> > > > > > >
> > > > > > > Apache - http.conf:
> > > > > > >
> > > > > > > <VirtualHost *:80>
> > > > > > > DocumentRoot
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > /usr/local/apache/share/saab_current/htdocs/
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > > ServerName test.domain
> > > > > > > Options FollowSymLinks +Indexes
> > > > > > > <Directory /usr/local/apache/share/htdocs>
> > > > > > > Options +Indexes
> > > > > > > </Directory>
> > > > > > > DirectoryIndex index.jhtml index.html index.xml
> > > > > > > JkMount /*.shtml xmlworker
> > > > > > > JkMount /main/*.jhtml xmlworker
> > > > > > > </VirtualHost>
> > > > > > >
> > > > > > > Tomcat - server.xml
> > > > > > > <Engine name="Catalina" defaultHost="test.domain"
> > > > > > > cachingAllowed="true" debug="9">
> > > > > > > <Host name="test.domain" debug="9"
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > appBase="/usr/local/apache/share/htdocs"
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > > unpackWARs="true" autoDeploy="true" xmlValidation="false"
> > > > > > > xmlNamespaceAware="false">
> > > > > > > <Context debug="9"
> > > > > > > reloadable="true"
> > > > > > > path=""
> > > > > > > docBase="/usr/local/apache/share/htdocs"
> > > > > > > />
> > > > > > > </Host>
> > > > > > > </Engine>
> > > > > > >
> > > > > > > Tomcat - workers.properties
> > > > > > >
> > > > > > > # XML worker
> > > > > > > worker.xmlworker.port=8009
> > > > > > > worker.xmlworker.host=localhost
> > > > > > > worker.xmlworker.type=ajp13
> > > > > > >
> > > > > > > Cocoon - sitemap.xmap
> > > > > > >
> > > > > > > <map:match pattern="*.jhtml">
> > > > > > > <map:generate src="pageOne.xml"/>
> > > > > > > <map:transform src="doc2html.xsl"/>
> > > > > > > <map:serialize type="html"/>
> > > > > > > </map:match>
> > > > > > >
> > > > > > > <map:match pattern="/main/*.jhtml">
> > > > > > > <map:generate src="/main/pageTwo.xml"/>
> > > > > > > <map:transform src="/main/doc2html.xsl"/>
> > > > > > > <map:serialize type="html"/>
> > > > > > > </map:match>
> > > > > > >
> > > > > > > My set-up is:
> > > > > > >
> > > > > > > Fedora Core 6
> > > > > > > Apache/2.2.8
> > > > > > > mod_jk 1.2.26
> > > > > > > Tomcat  5.5.26
> > > > > > > Cocoon 2.1.11
> > > > > > > Sun JDK 1.6.0_05-b13
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > To unsubscribe, e-mail:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > users-unsubscribe@cocoon.apache.org
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >  --
> > > > >  Met vriendelijke groet,
> > > > >  Kind regards,
> > > > >
> > > > >  Jeroen Reijn
> > > > >
> > > > >  Hippo
> > > > >
> > > > >  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam
> +31(0)20-5224466
> > > > >  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
> > > > >  94952-3329 +1 (707) 773-4646
> > > > >
> > > > >  www.onehippo.com info@onehippo.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > >
> > >
> > > >
> > > > >  To unsubscribe, e-mail:
> > > > > users-unsubscribe@cocoon.apache.org
> > > > >  For additional commands, e-mail: users-help@cocoon.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > >
> > >
> > > > To unsubscribe, e-mail:
> > > >
> > > >
> > > users-unsubscribe@cocoon.apache.org
> > >
> > >
> > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > >
> > > >
> > > >
> > > >
> > >  --
> > >  Met vriendelijke groet,
> > >  Kind regards,
> > >
> > >  Jeroen Reijn
> > >
> > >  Hippo
> > >
> > >  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
> > >  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
> > >  94952-3329 +1 (707) 773-4646
> > >
> > >  www.onehippo.com info@onehippo.com
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > >  To unsubscribe, e-mail:
> > > users-unsubscribe@cocoon.apache.org
> > >  For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
>  For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by "Lehtonen, Mika" <mi...@digikartta.net>.
Hi,

can't you just leave the mod_jk out of this for now on and test directly 
with Tomcat e.g. configure it to listen port 8080. Another approach 
might be to leave Cocoon out and test some static material through 
mod_jk. That way you can assure that it is working properly.

mika

Jed kirjoitti:
> I know mod_jk is working because it's passing the request through to
> Tomcat. Instead of trying to serve the *.jhtml file from Apache, it's
> going to Tomcat which is then passing back it's *own* 404 message
> rather than the default apache version.
>
> I've got mod_jk in debug mod and looked at the output and its
> definately passing the request to Tomcat.
>
> - Jed
>
> On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
>   
>> Well then it must be your mod_jk configuration. I do not have a lot of
>> experience with that, since I normally use mod_rewrite or mod_proxy.
>>
>>  On the cocoon side the correct way to go is without the preceding "/", so
>>
>>  <map:match pattern="/main/*.jhtml">
>>   <map:generate src="/main/pageTwo.xml"/>
>>
>>  Should be
>>
>>  <map:match pattern="main/*.jhtml">
>>   <map:generate src="main/pageTwo.xml"/>
>>
>>  So somehow tomcat or apache does not know how to handle requests with /main
>> in front? You do not by accident have another context running inside your
>> tomcat that has the name main?
>>
>>  Gr.
>>
>>  Jeroen
>>
>>
>>  Jed wrote:
>>
>>     
>>> Hi Jeroen,
>>>
>>> Thanks for the suggestion. I did actually try that but it didn't solve it.
>>>       
>> :(
>>     
>>> The problem is that Tomcat still appears to NOT be passing any request
>>> for a *.jhtml document in the docroot/main folder to cocoon.
>>>
>>> As I said, when I ask for http://test.domain/test.jhtml cocoon
>>> recieves the request and processes it as seen in the sitemap.log file.
>>>
>>> However asking for http://test.domain/main/test.jhtml
>>>       
>> never gets past
>>     
>>> Tomcat. It never passes it to cocoon so it never matches a matcher and
>>> no request is ever seen in the sitemap.log. I just get a 404 from
>>> Tomcat as it's trying to return an actual file called "test.jhtml" :(
>>>
>>> - Jed
>>>
>>> On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
>>>
>>>       
>>>> Yes you are correct here. Remove the "/" from the beginning. Also use a
>>>> relative source:
>>>>
>>>>  Use
>>>>  <map:generate src="main/helloworld.xml"/>
>>>>
>>>>  instead of
>>>>
>>>>  <map:generate src="/main/helloworld.xml"/>
>>>>
>>>>  Regards,
>>>>
>>>>  Jeroen
>>>>
>>>>
>>>>
>>>>  Rainer Pruy wrote:
>>>>
>>>>
>>>>         
>>>>> Hi Jed,
>>>>>
>>>>> you might try using <map:match pattern="main/*.jhtml"> (leaving out
>>>>>           
>> the
>>     
>>>> "/").
>>>>
>>>>         
>>>>> I remember having experienced similar problem some tim ago.
>>>>>
>>>>> Regards
>>>>> Rainer
>>>>>
>>>>> Jed schrieb:
>>>>>
>>>>>
>>>>>           
>>>>>> Hi All,
>>>>>>
>>>>>> I'm a new Cocoon user and I've come across and I'm having a really
>>>>>> bizarre problem at the moment which has stopped my site development
>>>>>>             
>> in
>>     
>>>>>> it's tracks.
>>>>>>
>>>>>> I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
>>>>>> Cocoon samples running just fine. I've set-up a virtual server with
>>>>>> it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
>>>>>> test and again, those work both fine.
>>>>>>
>>>>>> However, I've now started setting up my pipelines/matchers and a
>>>>>> really strange thing is happening.
>>>>>>
>>>>>> As a test, I've put "helloworld.xml" and its associated xsl file in
>>>>>> docroot and set-up a matcher so that and request for /*.jhtml
>>>>>> effectively loads and transforms that file. This works fine.
>>>>>>             
>> However,
>>     
>>>>>> if I then make a subdirectory of docroot and place the same xml/xsl
>>>>>> there and set-up a matcher for that, absolutely nothing happens.
>>>>>> Instead I just get a Tomcat 404 page.
>>>>>>
>>>>>> I've been scratching my head over this for a week and what appears
>>>>>>             
>> to
>>     
>>>>>> be the problem is that Tomcat is definately passing requests for
>>>>>> documents in docroot to cocoon but NOT for any sub-directories.
>>>>>>
>>>>>> The way I tested was as follows:
>>>>>>
>>>>>> Test 1:
>>>>>>
>>>>>> Created files:
>>>>>> docroot/helloworld.xml
>>>>>> docroot/helloworld.xsl
>>>>>>
>>>>>> Matcher:
>>>>>> <map:match pattern="*.jhtml">
>>>>>> <map:generate src="helloworld.xml"/>
>>>>>> <map:transform src="helloworld.xsl"/>
>>>>>> <map:serialize type="html"/>
>>>>>> </map:match>
>>>>>>
>>>>>> Request:
>>>>>> http://test.domain/randomfilename.jhtml
>>>>>>
>>>>>> Result:
>>>>>> "Hello World!"
>>>>>>
>>>>>> Test 2:
>>>>>>
>>>>>> Create files:
>>>>>> docroot/main/helloworld.xml
>>>>>> docroot/main/helloworld.xsl
>>>>>>
>>>>>> Matcher:
>>>>>> <map:match pattern="/main/*.jhtml">
>>>>>> <map:generate src="/main/helloworld.xml"/>
>>>>>> <map:transform src="/main/helloworld.xsl"/>
>>>>>> <map:serialize type="html"/>
>>>>>> </map:match>
>>>>>>
>>>>>> Request:
>>>>>> http://test.domain/main/randomfilename.jhtml
>>>>>>
>>>>>> Result:
>>>>>> Tomcat 404 error message
>>>>>>
>>>>>> Test 3:
>>>>>>
>>>>>> Remove files:
>>>>>> docroot/helloworld.xml
>>>>>> docroot/helloworld.xsl
>>>>>>
>>>>>> Matcher:
>>>>>> <map:match pattern="*.jhtml">
>>>>>> <map:generate src="helloworld.xml"/>
>>>>>> <map:transform src="helloworld.xsl"/>
>>>>>> <map:serialize type="html"/>
>>>>>> </map:match>
>>>>>>
>>>>>> Request:
>>>>>> http://test.domain/randomfilename.jhtml
>>>>>>
>>>>>> Result:
>>>>>> Coccon 404 error message as defined in <map:handle-errors>
>>>>>>
>>>>>> I have DEBUG level set in logkit and watched what was happening when
>>>>>>             
>> I
>>     
>>>>>> made requests. mod_jk was intercepting the request from apache and
>>>>>> matching it with a worker and passing it to Tomcat. For requests for
>>>>>> documents in docroot, Tomcat was passing them to cocoon as the
>>>>>> requests and processing can be seen in the sitemap.log file.
>>>>>>
>>>>>> However, when a request is made for a file in a sub-directory of
>>>>>> docroot, there is zero activity in sitemap.log - the request just
>>>>>> never gets there!
>>>>>>
>>>>>> I am *completely* baffled. I believe I have the various components
>>>>>> configured correctly but as stated, Tomcat will not pass requests
>>>>>>             
>> for
>>     
>>>>>> sub-dirs to Cocoon.
>>>>>>
>>>>>> Can anyone shed any light on this?
>>>>>>
>>>>>> - Jed
>>>>>>
>>>>>> Heres the pertinent extracts from the various configs:
>>>>>>
>>>>>> Apache - http.conf:
>>>>>>
>>>>>> <VirtualHost *:80>
>>>>>> DocumentRoot
>>>>>>
>>>>>>             
>>>> /usr/local/apache/share/saab_current/htdocs/
>>>>
>>>>         
>>>>>> ServerName test.domain
>>>>>> Options FollowSymLinks +Indexes
>>>>>> <Directory /usr/local/apache/share/htdocs>
>>>>>> Options +Indexes
>>>>>> </Directory>
>>>>>> DirectoryIndex index.jhtml index.html index.xml
>>>>>> JkMount /*.shtml xmlworker
>>>>>> JkMount /main/*.jhtml xmlworker
>>>>>> </VirtualHost>
>>>>>>
>>>>>> Tomcat - server.xml
>>>>>> <Engine name="Catalina" defaultHost="test.domain"
>>>>>> cachingAllowed="true" debug="9">
>>>>>> <Host name="test.domain" debug="9"
>>>>>>
>>>>>>             
>>>> appBase="/usr/local/apache/share/htdocs"
>>>>
>>>>         
>>>>>> unpackWARs="true" autoDeploy="true" xmlValidation="false"
>>>>>> xmlNamespaceAware="false">
>>>>>> <Context debug="9"
>>>>>> reloadable="true"
>>>>>> path=""
>>>>>> docBase="/usr/local/apache/share/htdocs"
>>>>>> />
>>>>>> </Host>
>>>>>> </Engine>
>>>>>>
>>>>>> Tomcat - workers.properties
>>>>>>
>>>>>> # XML worker
>>>>>> worker.xmlworker.port=8009
>>>>>> worker.xmlworker.host=localhost
>>>>>> worker.xmlworker.type=ajp13
>>>>>>
>>>>>> Cocoon - sitemap.xmap
>>>>>>
>>>>>> <map:match pattern="*.jhtml">
>>>>>> <map:generate src="pageOne.xml"/>
>>>>>> <map:transform src="doc2html.xsl"/>
>>>>>> <map:serialize type="html"/>
>>>>>> </map:match>
>>>>>>
>>>>>> <map:match pattern="/main/*.jhtml">
>>>>>> <map:generate src="/main/pageTwo.xml"/>
>>>>>> <map:transform src="/main/doc2html.xsl"/>
>>>>>> <map:serialize type="html"/>
>>>>>> </map:match>
>>>>>>
>>>>>> My set-up is:
>>>>>>
>>>>>> Fedora Core 6
>>>>>> Apache/2.2.8
>>>>>> mod_jk 1.2.26
>>>>>> Tomcat  5.5.26
>>>>>> Cocoon 2.1.11
>>>>>> Sun JDK 1.6.0_05-b13
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>> ---------------------------------------------------------------------
>>     
>>>>>> To unsubscribe, e-mail:
>>>>>>
>>>>>>             
>>>> users-unsubscribe@cocoon.apache.org
>>>>
>>>>         
>>>>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>           
>>>>  --
>>>>  Met vriendelijke groet,
>>>>  Kind regards,
>>>>
>>>>  Jeroen Reijn
>>>>
>>>>  Hippo
>>>>
>>>>  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
>>>>  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
>>>>  94952-3329 +1 (707) 773-4646
>>>>
>>>>  www.onehippo.com info@onehippo.com
>>>>
>>>>
>>>>
>>>>
>>>>         
>> ---------------------------------------------------------------------
>>     
>>>>  To unsubscribe, e-mail:
>>>> users-unsubscribe@cocoon.apache.org
>>>>  For additional commands, e-mail: users-help@cocoon.apache.org
>>>>
>>>>
>>>>
>>>>         
>>>       
>> ---------------------------------------------------------------------
>>     
>>> To unsubscribe, e-mail:
>>>       
>> users-unsubscribe@cocoon.apache.org
>>     
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>>       
>>  --
>>  Met vriendelijke groet,
>>  Kind regards,
>>
>>  Jeroen Reijn
>>
>>  Hippo
>>
>>  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
>>  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
>>  94952-3329 +1 (707) 773-4646
>>
>>  www.onehippo.com info@onehippo.com
>>
>>
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail:
>> users-unsubscribe@cocoon.apache.org
>>  For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>   

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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jed <je...@wunderboy.org>.
I know mod_jk is working because it's passing the request through to
Tomcat. Instead of trying to serve the *.jhtml file from Apache, it's
going to Tomcat which is then passing back it's *own* 404 message
rather than the default apache version.

I've got mod_jk in debug mod and looked at the output and its
definately passing the request to Tomcat.

- Jed

On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
> Well then it must be your mod_jk configuration. I do not have a lot of
> experience with that, since I normally use mod_rewrite or mod_proxy.
>
>  On the cocoon side the correct way to go is without the preceding "/", so
>
>  <map:match pattern="/main/*.jhtml">
>   <map:generate src="/main/pageTwo.xml"/>
>
>  Should be
>
>  <map:match pattern="main/*.jhtml">
>   <map:generate src="main/pageTwo.xml"/>
>
>  So somehow tomcat or apache does not know how to handle requests with /main
> in front? You do not by accident have another context running inside your
> tomcat that has the name main?
>
>  Gr.
>
>  Jeroen
>
>
>  Jed wrote:
>
> > Hi Jeroen,
> >
> > Thanks for the suggestion. I did actually try that but it didn't solve it.
> :(
> >
> > The problem is that Tomcat still appears to NOT be passing any request
> > for a *.jhtml document in the docroot/main folder to cocoon.
> >
> > As I said, when I ask for http://test.domain/test.jhtml cocoon
> > recieves the request and processes it as seen in the sitemap.log file.
> >
> > However asking for http://test.domain/main/test.jhtml
> never gets past
> > Tomcat. It never passes it to cocoon so it never matches a matcher and
> > no request is ever seen in the sitemap.log. I just get a 404 from
> > Tomcat as it's trying to return an actual file called "test.jhtml" :(
> >
> > - Jed
> >
> > On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
> >
> > > Yes you are correct here. Remove the "/" from the beginning. Also use a
> > > relative source:
> > >
> > >  Use
> > >  <map:generate src="main/helloworld.xml"/>
> > >
> > >  instead of
> > >
> > >  <map:generate src="/main/helloworld.xml"/>
> > >
> > >  Regards,
> > >
> > >  Jeroen
> > >
> > >
> > >
> > >  Rainer Pruy wrote:
> > >
> > >
> > > > Hi Jed,
> > > >
> > > > you might try using <map:match pattern="main/*.jhtml"> (leaving out
> the
> > > >
> > > "/").
> > >
> > > > I remember having experienced similar problem some tim ago.
> > > >
> > > > Regards
> > > > Rainer
> > > >
> > > > Jed schrieb:
> > > >
> > > >
> > > > > Hi All,
> > > > >
> > > > > I'm a new Cocoon user and I've come across and I'm having a really
> > > > > bizarre problem at the moment which has stopped my site development
> in
> > > > > it's tracks.
> > > > >
> > > > > I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
> > > > > Cocoon samples running just fine. I've set-up a virtual server with
> > > > > it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
> > > > > test and again, those work both fine.
> > > > >
> > > > > However, I've now started setting up my pipelines/matchers and a
> > > > > really strange thing is happening.
> > > > >
> > > > > As a test, I've put "helloworld.xml" and its associated xsl file in
> > > > > docroot and set-up a matcher so that and request for /*.jhtml
> > > > > effectively loads and transforms that file. This works fine.
> However,
> > > > > if I then make a subdirectory of docroot and place the same xml/xsl
> > > > > there and set-up a matcher for that, absolutely nothing happens.
> > > > > Instead I just get a Tomcat 404 page.
> > > > >
> > > > > I've been scratching my head over this for a week and what appears
> to
> > > > > be the problem is that Tomcat is definately passing requests for
> > > > > documents in docroot to cocoon but NOT for any sub-directories.
> > > > >
> > > > > The way I tested was as follows:
> > > > >
> > > > > Test 1:
> > > > >
> > > > > Created files:
> > > > > docroot/helloworld.xml
> > > > > docroot/helloworld.xsl
> > > > >
> > > > > Matcher:
> > > > > <map:match pattern="*.jhtml">
> > > > > <map:generate src="helloworld.xml"/>
> > > > > <map:transform src="helloworld.xsl"/>
> > > > > <map:serialize type="html"/>
> > > > > </map:match>
> > > > >
> > > > > Request:
> > > > > http://test.domain/randomfilename.jhtml
> > > > >
> > > > > Result:
> > > > > "Hello World!"
> > > > >
> > > > > Test 2:
> > > > >
> > > > > Create files:
> > > > > docroot/main/helloworld.xml
> > > > > docroot/main/helloworld.xsl
> > > > >
> > > > > Matcher:
> > > > > <map:match pattern="/main/*.jhtml">
> > > > > <map:generate src="/main/helloworld.xml"/>
> > > > > <map:transform src="/main/helloworld.xsl"/>
> > > > > <map:serialize type="html"/>
> > > > > </map:match>
> > > > >
> > > > > Request:
> > > > > http://test.domain/main/randomfilename.jhtml
> > > > >
> > > > > Result:
> > > > > Tomcat 404 error message
> > > > >
> > > > > Test 3:
> > > > >
> > > > > Remove files:
> > > > > docroot/helloworld.xml
> > > > > docroot/helloworld.xsl
> > > > >
> > > > > Matcher:
> > > > > <map:match pattern="*.jhtml">
> > > > > <map:generate src="helloworld.xml"/>
> > > > > <map:transform src="helloworld.xsl"/>
> > > > > <map:serialize type="html"/>
> > > > > </map:match>
> > > > >
> > > > > Request:
> > > > > http://test.domain/randomfilename.jhtml
> > > > >
> > > > > Result:
> > > > > Coccon 404 error message as defined in <map:handle-errors>
> > > > >
> > > > > I have DEBUG level set in logkit and watched what was happening when
> I
> > > > > made requests. mod_jk was intercepting the request from apache and
> > > > > matching it with a worker and passing it to Tomcat. For requests for
> > > > > documents in docroot, Tomcat was passing them to cocoon as the
> > > > > requests and processing can be seen in the sitemap.log file.
> > > > >
> > > > > However, when a request is made for a file in a sub-directory of
> > > > > docroot, there is zero activity in sitemap.log - the request just
> > > > > never gets there!
> > > > >
> > > > > I am *completely* baffled. I believe I have the various components
> > > > > configured correctly but as stated, Tomcat will not pass requests
> for
> > > > > sub-dirs to Cocoon.
> > > > >
> > > > > Can anyone shed any light on this?
> > > > >
> > > > > - Jed
> > > > >
> > > > > Heres the pertinent extracts from the various configs:
> > > > >
> > > > > Apache - http.conf:
> > > > >
> > > > > <VirtualHost *:80>
> > > > > DocumentRoot
> > > > >
> > > >
> > > /usr/local/apache/share/saab_current/htdocs/
> > >
> > > >
> > > > > ServerName test.domain
> > > > > Options FollowSymLinks +Indexes
> > > > > <Directory /usr/local/apache/share/htdocs>
> > > > > Options +Indexes
> > > > > </Directory>
> > > > > DirectoryIndex index.jhtml index.html index.xml
> > > > > JkMount /*.shtml xmlworker
> > > > > JkMount /main/*.jhtml xmlworker
> > > > > </VirtualHost>
> > > > >
> > > > > Tomcat - server.xml
> > > > > <Engine name="Catalina" defaultHost="test.domain"
> > > > > cachingAllowed="true" debug="9">
> > > > > <Host name="test.domain" debug="9"
> > > > >
> > > >
> > > appBase="/usr/local/apache/share/htdocs"
> > >
> > > >
> > > > > unpackWARs="true" autoDeploy="true" xmlValidation="false"
> > > > > xmlNamespaceAware="false">
> > > > > <Context debug="9"
> > > > > reloadable="true"
> > > > > path=""
> > > > > docBase="/usr/local/apache/share/htdocs"
> > > > > />
> > > > > </Host>
> > > > > </Engine>
> > > > >
> > > > > Tomcat - workers.properties
> > > > >
> > > > > # XML worker
> > > > > worker.xmlworker.port=8009
> > > > > worker.xmlworker.host=localhost
> > > > > worker.xmlworker.type=ajp13
> > > > >
> > > > > Cocoon - sitemap.xmap
> > > > >
> > > > > <map:match pattern="*.jhtml">
> > > > > <map:generate src="pageOne.xml"/>
> > > > > <map:transform src="doc2html.xsl"/>
> > > > > <map:serialize type="html"/>
> > > > > </map:match>
> > > > >
> > > > > <map:match pattern="/main/*.jhtml">
> > > > > <map:generate src="/main/pageTwo.xml"/>
> > > > > <map:transform src="/main/doc2html.xsl"/>
> > > > > <map:serialize type="html"/>
> > > > > </map:match>
> > > > >
> > > > > My set-up is:
> > > > >
> > > > > Fedora Core 6
> > > > > Apache/2.2.8
> > > > > mod_jk 1.2.26
> > > > > Tomcat  5.5.26
> > > > > Cocoon 2.1.11
> > > > > Sun JDK 1.6.0_05-b13
> > > > >
> > > > >
> > > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > >
> > > >
> > > > > To unsubscribe, e-mail:
> > > > >
> > > >
> > > users-unsubscribe@cocoon.apache.org
> > >
> > > >
> > > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >  --
> > >  Met vriendelijke groet,
> > >  Kind regards,
> > >
> > >  Jeroen Reijn
> > >
> > >  Hippo
> > >
> > >  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
> > >  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
> > >  94952-3329 +1 (707) 773-4646
> > >
> > >  www.onehippo.com info@onehippo.com
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > >  To unsubscribe, e-mail:
> > > users-unsubscribe@cocoon.apache.org
> > >  For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
>  --
>  Met vriendelijke groet,
>  Kind regards,
>
>  Jeroen Reijn
>
>  Hippo
>
>  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
>  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
>  94952-3329 +1 (707) 773-4646
>
>  www.onehippo.com info@onehippo.com
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
>  For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jeroen Reijn <j....@onehippo.com>.
Well then it must be your mod_jk configuration. I do not have a lot of 
experience with that, since I normally use mod_rewrite or mod_proxy.

On the cocoon side the correct way to go is without the preceding "/", so

<map:match pattern="/main/*.jhtml">
  <map:generate src="/main/pageTwo.xml"/>

Should be

<map:match pattern="main/*.jhtml">
  <map:generate src="main/pageTwo.xml"/>

So somehow tomcat or apache does not know how to handle requests with 
/main in front? You do not by accident have another context running 
inside your tomcat that has the name main?

Gr.

Jeroen

Jed wrote:
> Hi Jeroen,
> 
> Thanks for the suggestion. I did actually try that but it didn't solve it. :(
> 
> The problem is that Tomcat still appears to NOT be passing any request
> for a *.jhtml document in the docroot/main folder to cocoon.
> 
> As I said, when I ask for http://test.domain/test.jhtml cocoon
> recieves the request and processes it as seen in the sitemap.log file.
> 
> However asking for http://test.domain/main/test.jhtml never gets past
> Tomcat. It never passes it to cocoon so it never matches a matcher and
> no request is ever seen in the sitemap.log. I just get a 404 from
> Tomcat as it's trying to return an actual file called "test.jhtml" :(
> 
> - Jed
> 
> On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
>> Yes you are correct here. Remove the "/" from the beginning. Also use a
>> relative source:
>>
>>  Use
>>  <map:generate src="main/helloworld.xml"/>
>>
>>  instead of
>>
>>  <map:generate src="/main/helloworld.xml"/>
>>
>>  Regards,
>>
>>  Jeroen
>>
>>
>>
>>  Rainer Pruy wrote:
>>
>>> Hi Jed,
>>>
>>> you might try using <map:match pattern="main/*.jhtml"> (leaving out the
>> "/").
>>> I remember having experienced similar problem some tim ago.
>>>
>>> Regards
>>> Rainer
>>>
>>> Jed schrieb:
>>>
>>>> Hi All,
>>>>
>>>> I'm a new Cocoon user and I've come across and I'm having a really
>>>> bizarre problem at the moment which has stopped my site development in
>>>> it's tracks.
>>>>
>>>> I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
>>>> Cocoon samples running just fine. I've set-up a virtual server with
>>>> it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
>>>> test and again, those work both fine.
>>>>
>>>> However, I've now started setting up my pipelines/matchers and a
>>>> really strange thing is happening.
>>>>
>>>> As a test, I've put "helloworld.xml" and its associated xsl file in
>>>> docroot and set-up a matcher so that and request for /*.jhtml
>>>> effectively loads and transforms that file. This works fine. However,
>>>> if I then make a subdirectory of docroot and place the same xml/xsl
>>>> there and set-up a matcher for that, absolutely nothing happens.
>>>> Instead I just get a Tomcat 404 page.
>>>>
>>>> I've been scratching my head over this for a week and what appears to
>>>> be the problem is that Tomcat is definately passing requests for
>>>> documents in docroot to cocoon but NOT for any sub-directories.
>>>>
>>>> The way I tested was as follows:
>>>>
>>>> Test 1:
>>>>
>>>> Created files:
>>>> docroot/helloworld.xml
>>>> docroot/helloworld.xsl
>>>>
>>>> Matcher:
>>>> <map:match pattern="*.jhtml">
>>>> <map:generate src="helloworld.xml"/>
>>>> <map:transform src="helloworld.xsl"/>
>>>> <map:serialize type="html"/>
>>>> </map:match>
>>>>
>>>> Request:
>>>> http://test.domain/randomfilename.jhtml
>>>>
>>>> Result:
>>>> "Hello World!"
>>>>
>>>> Test 2:
>>>>
>>>> Create files:
>>>> docroot/main/helloworld.xml
>>>> docroot/main/helloworld.xsl
>>>>
>>>> Matcher:
>>>> <map:match pattern="/main/*.jhtml">
>>>> <map:generate src="/main/helloworld.xml"/>
>>>> <map:transform src="/main/helloworld.xsl"/>
>>>> <map:serialize type="html"/>
>>>> </map:match>
>>>>
>>>> Request:
>>>> http://test.domain/main/randomfilename.jhtml
>>>>
>>>> Result:
>>>> Tomcat 404 error message
>>>>
>>>> Test 3:
>>>>
>>>> Remove files:
>>>> docroot/helloworld.xml
>>>> docroot/helloworld.xsl
>>>>
>>>> Matcher:
>>>> <map:match pattern="*.jhtml">
>>>> <map:generate src="helloworld.xml"/>
>>>> <map:transform src="helloworld.xsl"/>
>>>> <map:serialize type="html"/>
>>>> </map:match>
>>>>
>>>> Request:
>>>> http://test.domain/randomfilename.jhtml
>>>>
>>>> Result:
>>>> Coccon 404 error message as defined in <map:handle-errors>
>>>>
>>>> I have DEBUG level set in logkit and watched what was happening when I
>>>> made requests. mod_jk was intercepting the request from apache and
>>>> matching it with a worker and passing it to Tomcat. For requests for
>>>> documents in docroot, Tomcat was passing them to cocoon as the
>>>> requests and processing can be seen in the sitemap.log file.
>>>>
>>>> However, when a request is made for a file in a sub-directory of
>>>> docroot, there is zero activity in sitemap.log - the request just
>>>> never gets there!
>>>>
>>>> I am *completely* baffled. I believe I have the various components
>>>> configured correctly but as stated, Tomcat will not pass requests for
>>>> sub-dirs to Cocoon.
>>>>
>>>> Can anyone shed any light on this?
>>>>
>>>> - Jed
>>>>
>>>> Heres the pertinent extracts from the various configs:
>>>>
>>>> Apache - http.conf:
>>>>
>>>> <VirtualHost *:80>
>>>> DocumentRoot
>> /usr/local/apache/share/saab_current/htdocs/
>>>> ServerName test.domain
>>>> Options FollowSymLinks +Indexes
>>>> <Directory /usr/local/apache/share/htdocs>
>>>> Options +Indexes
>>>> </Directory>
>>>> DirectoryIndex index.jhtml index.html index.xml
>>>> JkMount /*.shtml xmlworker
>>>> JkMount /main/*.jhtml xmlworker
>>>> </VirtualHost>
>>>>
>>>> Tomcat - server.xml
>>>> <Engine name="Catalina" defaultHost="test.domain"
>>>> cachingAllowed="true" debug="9">
>>>> <Host name="test.domain" debug="9"
>> appBase="/usr/local/apache/share/htdocs"
>>>> unpackWARs="true" autoDeploy="true" xmlValidation="false"
>>>> xmlNamespaceAware="false">
>>>> <Context debug="9"
>>>> reloadable="true"
>>>> path=""
>>>> docBase="/usr/local/apache/share/htdocs"
>>>> />
>>>> </Host>
>>>> </Engine>
>>>>
>>>> Tomcat - workers.properties
>>>>
>>>> # XML worker
>>>> worker.xmlworker.port=8009
>>>> worker.xmlworker.host=localhost
>>>> worker.xmlworker.type=ajp13
>>>>
>>>> Cocoon - sitemap.xmap
>>>>
>>>> <map:match pattern="*.jhtml">
>>>> <map:generate src="pageOne.xml"/>
>>>> <map:transform src="doc2html.xsl"/>
>>>> <map:serialize type="html"/>
>>>> </map:match>
>>>>
>>>> <map:match pattern="/main/*.jhtml">
>>>> <map:generate src="/main/pageTwo.xml"/>
>>>> <map:transform src="/main/doc2html.xsl"/>
>>>> <map:serialize type="html"/>
>>>> </map:match>
>>>>
>>>> My set-up is:
>>>>
>>>> Fedora Core 6
>>>> Apache/2.2.8
>>>> mod_jk 1.2.26
>>>> Tomcat  5.5.26
>>>> Cocoon 2.1.11
>>>> Sun JDK 1.6.0_05-b13
>>>>
>>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>> users-unsubscribe@cocoon.apache.org
>>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>>
>>>>
>>>
>>  --
>>  Met vriendelijke groet,
>>  Kind regards,
>>
>>  Jeroen Reijn
>>
>>  Hippo
>>
>>  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
>>  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
>>  94952-3329 +1 (707) 773-4646
>>
>>  www.onehippo.com info@onehippo.com
>>
>>
>>
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail:
>> users-unsubscribe@cocoon.apache.org
>>  For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
Met vriendelijke groet,
Kind regards,

Jeroen Reijn

Hippo

Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646

www.onehippo.com info@onehippo.com


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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Nikolas List <li...@metromorph.de>.
Hi Jed,

Jed schrieb:
> Hi Jeroen,
> 
> Thanks for the suggestion. I did actually try that but it didn't solve it. :(
> 
> The problem is that Tomcat still appears to NOT be passing any request
> for a *.jhtml document in the docroot/main folder to cocoon.
> 
> As I said, when I ask for http://test.domain/test.jhtml cocoon
> recieves the request and processes it as seen in the sitemap.log file.
> 
> However asking for http://test.domain/main/test.jhtml never gets past
> Tomcat. It never passes it to cocoon so it never matches a matcher and
> no request is ever seen in the sitemap.log. I just get a 404 from
> Tomcat as it's trying to return an actual file called "test.jhtml" :(
> 

Did you have a look in the <servlet-mapping> of WEB-INF/web.xml?

Perhaps sth is wrong there?

Regards
Niko


[SNIP]

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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jed <je...@wunderboy.org>.
Hi Jeroen,

Thanks for the suggestion. I did actually try that but it didn't solve it. :(

The problem is that Tomcat still appears to NOT be passing any request
for a *.jhtml document in the docroot/main folder to cocoon.

As I said, when I ask for http://test.domain/test.jhtml cocoon
recieves the request and processes it as seen in the sitemap.log file.

However asking for http://test.domain/main/test.jhtml never gets past
Tomcat. It never passes it to cocoon so it never matches a matcher and
no request is ever seen in the sitemap.log. I just get a 404 from
Tomcat as it's trying to return an actual file called "test.jhtml" :(

- Jed

On 10/04/2008, Jeroen Reijn <j....@onehippo.com> wrote:
> Yes you are correct here. Remove the "/" from the beginning. Also use a
> relative source:
>
>  Use
>  <map:generate src="main/helloworld.xml"/>
>
>  instead of
>
>  <map:generate src="/main/helloworld.xml"/>
>
>  Regards,
>
>  Jeroen
>
>
>
>  Rainer Pruy wrote:
>
> > Hi Jed,
> >
> > you might try using <map:match pattern="main/*.jhtml"> (leaving out the
> "/").
> > I remember having experienced similar problem some tim ago.
> >
> > Regards
> > Rainer
> >
> > Jed schrieb:
> >
> > > Hi All,
> > >
> > > I'm a new Cocoon user and I've come across and I'm having a really
> > > bizarre problem at the moment which has stopped my site development in
> > > it's tracks.
> > >
> > > I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
> > > Cocoon samples running just fine. I've set-up a virtual server with
> > > it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
> > > test and again, those work both fine.
> > >
> > > However, I've now started setting up my pipelines/matchers and a
> > > really strange thing is happening.
> > >
> > > As a test, I've put "helloworld.xml" and its associated xsl file in
> > > docroot and set-up a matcher so that and request for /*.jhtml
> > > effectively loads and transforms that file. This works fine. However,
> > > if I then make a subdirectory of docroot and place the same xml/xsl
> > > there and set-up a matcher for that, absolutely nothing happens.
> > > Instead I just get a Tomcat 404 page.
> > >
> > > I've been scratching my head over this for a week and what appears to
> > > be the problem is that Tomcat is definately passing requests for
> > > documents in docroot to cocoon but NOT for any sub-directories.
> > >
> > > The way I tested was as follows:
> > >
> > > Test 1:
> > >
> > > Created files:
> > > docroot/helloworld.xml
> > > docroot/helloworld.xsl
> > >
> > > Matcher:
> > > <map:match pattern="*.jhtml">
> > > <map:generate src="helloworld.xml"/>
> > > <map:transform src="helloworld.xsl"/>
> > > <map:serialize type="html"/>
> > > </map:match>
> > >
> > > Request:
> > > http://test.domain/randomfilename.jhtml
> > >
> > > Result:
> > > "Hello World!"
> > >
> > > Test 2:
> > >
> > > Create files:
> > > docroot/main/helloworld.xml
> > > docroot/main/helloworld.xsl
> > >
> > > Matcher:
> > > <map:match pattern="/main/*.jhtml">
> > > <map:generate src="/main/helloworld.xml"/>
> > > <map:transform src="/main/helloworld.xsl"/>
> > > <map:serialize type="html"/>
> > > </map:match>
> > >
> > > Request:
> > > http://test.domain/main/randomfilename.jhtml
> > >
> > > Result:
> > > Tomcat 404 error message
> > >
> > > Test 3:
> > >
> > > Remove files:
> > > docroot/helloworld.xml
> > > docroot/helloworld.xsl
> > >
> > > Matcher:
> > > <map:match pattern="*.jhtml">
> > > <map:generate src="helloworld.xml"/>
> > > <map:transform src="helloworld.xsl"/>
> > > <map:serialize type="html"/>
> > > </map:match>
> > >
> > > Request:
> > > http://test.domain/randomfilename.jhtml
> > >
> > > Result:
> > > Coccon 404 error message as defined in <map:handle-errors>
> > >
> > > I have DEBUG level set in logkit and watched what was happening when I
> > > made requests. mod_jk was intercepting the request from apache and
> > > matching it with a worker and passing it to Tomcat. For requests for
> > > documents in docroot, Tomcat was passing them to cocoon as the
> > > requests and processing can be seen in the sitemap.log file.
> > >
> > > However, when a request is made for a file in a sub-directory of
> > > docroot, there is zero activity in sitemap.log - the request just
> > > never gets there!
> > >
> > > I am *completely* baffled. I believe I have the various components
> > > configured correctly but as stated, Tomcat will not pass requests for
> > > sub-dirs to Cocoon.
> > >
> > > Can anyone shed any light on this?
> > >
> > > - Jed
> > >
> > > Heres the pertinent extracts from the various configs:
> > >
> > > Apache - http.conf:
> > >
> > > <VirtualHost *:80>
> > > DocumentRoot
> /usr/local/apache/share/saab_current/htdocs/
> > > ServerName test.domain
> > > Options FollowSymLinks +Indexes
> > > <Directory /usr/local/apache/share/htdocs>
> > > Options +Indexes
> > > </Directory>
> > > DirectoryIndex index.jhtml index.html index.xml
> > > JkMount /*.shtml xmlworker
> > > JkMount /main/*.jhtml xmlworker
> > > </VirtualHost>
> > >
> > > Tomcat - server.xml
> > > <Engine name="Catalina" defaultHost="test.domain"
> > > cachingAllowed="true" debug="9">
> > > <Host name="test.domain" debug="9"
> appBase="/usr/local/apache/share/htdocs"
> > > unpackWARs="true" autoDeploy="true" xmlValidation="false"
> > > xmlNamespaceAware="false">
> > > <Context debug="9"
> > > reloadable="true"
> > > path=""
> > > docBase="/usr/local/apache/share/htdocs"
> > > />
> > > </Host>
> > > </Engine>
> > >
> > > Tomcat - workers.properties
> > >
> > > # XML worker
> > > worker.xmlworker.port=8009
> > > worker.xmlworker.host=localhost
> > > worker.xmlworker.type=ajp13
> > >
> > > Cocoon - sitemap.xmap
> > >
> > > <map:match pattern="*.jhtml">
> > > <map:generate src="pageOne.xml"/>
> > > <map:transform src="doc2html.xsl"/>
> > > <map:serialize type="html"/>
> > > </map:match>
> > >
> > > <map:match pattern="/main/*.jhtml">
> > > <map:generate src="/main/pageTwo.xml"/>
> > > <map:transform src="/main/doc2html.xsl"/>
> > > <map:serialize type="html"/>
> > > </map:match>
> > >
> > > My set-up is:
> > >
> > > Fedora Core 6
> > > Apache/2.2.8
> > > mod_jk 1.2.26
> > > Tomcat  5.5.26
> > > Cocoon 2.1.11
> > > Sun JDK 1.6.0_05-b13
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
> >
>
>  --
>  Met vriendelijke groet,
>  Kind regards,
>
>  Jeroen Reijn
>
>  Hippo
>
>  Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
>  San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
>  94952-3329 +1 (707) 773-4646
>
>  www.onehippo.com info@onehippo.com
>
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
>  For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jeroen Reijn <j....@onehippo.com>.
Yes you are correct here. Remove the "/" from the beginning. Also use a 
relative source:

Use
<map:generate src="main/helloworld.xml"/>

instead of

<map:generate src="/main/helloworld.xml"/>

Regards,

Jeroen


Rainer Pruy wrote:
> Hi Jed,
> 
> you might try using <map:match pattern="main/*.jhtml"> (leaving out the "/").
> I remember having experienced similar problem some tim ago.
> 
> Regards
> Rainer
> 
> Jed schrieb:
>> Hi All,
>>
>> I'm a new Cocoon user and I've come across and I'm having a really
>> bizarre problem at the moment which has stopped my site development in
>> it's tracks.
>>
>> I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
>> Cocoon samples running just fine. I've set-up a virtual server with
>> it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
>> test and again, those work both fine.
>>
>> However, I've now started setting up my pipelines/matchers and a
>> really strange thing is happening.
>>
>> As a test, I've put "helloworld.xml" and its associated xsl file in
>> docroot and set-up a matcher so that and request for /*.jhtml
>> effectively loads and transforms that file. This works fine. However,
>> if I then make a subdirectory of docroot and place the same xml/xsl
>> there and set-up a matcher for that, absolutely nothing happens.
>> Instead I just get a Tomcat 404 page.
>>
>> I've been scratching my head over this for a week and what appears to
>> be the problem is that Tomcat is definately passing requests for
>> documents in docroot to cocoon but NOT for any sub-directories.
>>
>> The way I tested was as follows:
>>
>> Test 1:
>>
>> Created files:
>> docroot/helloworld.xml
>> docroot/helloworld.xsl
>>
>> Matcher:
>> <map:match pattern="*.jhtml">
>> <map:generate src="helloworld.xml"/>
>> <map:transform src="helloworld.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> Request:
>> http://test.domain/randomfilename.jhtml
>>
>> Result:
>> "Hello World!"
>>
>> Test 2:
>>
>> Create files:
>> docroot/main/helloworld.xml
>> docroot/main/helloworld.xsl
>>
>> Matcher:
>> <map:match pattern="/main/*.jhtml">
>> <map:generate src="/main/helloworld.xml"/>
>> <map:transform src="/main/helloworld.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> Request:
>> http://test.domain/main/randomfilename.jhtml
>>
>> Result:
>> Tomcat 404 error message
>>
>> Test 3:
>>
>> Remove files:
>> docroot/helloworld.xml
>> docroot/helloworld.xsl
>>
>> Matcher:
>> <map:match pattern="*.jhtml">
>> <map:generate src="helloworld.xml"/>
>> <map:transform src="helloworld.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> Request:
>> http://test.domain/randomfilename.jhtml
>>
>> Result:
>> Coccon 404 error message as defined in <map:handle-errors>
>>
>> I have DEBUG level set in logkit and watched what was happening when I
>> made requests. mod_jk was intercepting the request from apache and
>> matching it with a worker and passing it to Tomcat. For requests for
>> documents in docroot, Tomcat was passing them to cocoon as the
>> requests and processing can be seen in the sitemap.log file.
>>
>> However, when a request is made for a file in a sub-directory of
>> docroot, there is zero activity in sitemap.log - the request just
>> never gets there!
>>
>> I am *completely* baffled. I believe I have the various components
>> configured correctly but as stated, Tomcat will not pass requests for
>> sub-dirs to Cocoon.
>>
>> Can anyone shed any light on this?
>>
>> - Jed
>>
>> Heres the pertinent extracts from the various configs:
>>
>> Apache - http.conf:
>>
>> <VirtualHost *:80>
>> DocumentRoot /usr/local/apache/share/saab_current/htdocs/
>> ServerName test.domain
>> Options FollowSymLinks +Indexes
>> <Directory /usr/local/apache/share/htdocs>
>> Options +Indexes
>> </Directory>
>> DirectoryIndex index.jhtml index.html index.xml
>> JkMount /*.shtml xmlworker
>> JkMount /main/*.jhtml xmlworker
>> </VirtualHost>
>>
>> Tomcat - server.xml
>> <Engine name="Catalina" defaultHost="test.domain"
>> cachingAllowed="true" debug="9">
>> <Host name="test.domain" debug="9" appBase="/usr/local/apache/share/htdocs"
>> unpackWARs="true" autoDeploy="true" xmlValidation="false"
>> xmlNamespaceAware="false">
>> <Context debug="9"
>> reloadable="true"
>> path=""
>> docBase="/usr/local/apache/share/htdocs"
>> />
>> </Host>
>> </Engine>
>>
>> Tomcat - workers.properties
>>
>> # XML worker
>> worker.xmlworker.port=8009
>> worker.xmlworker.host=localhost
>> worker.xmlworker.type=ajp13
>>
>> Cocoon - sitemap.xmap
>>
>> <map:match pattern="*.jhtml">
>> <map:generate src="pageOne.xml"/>
>> <map:transform src="doc2html.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> <map:match pattern="/main/*.jhtml">
>> <map:generate src="/main/pageTwo.xml"/>
>> <map:transform src="/main/doc2html.xsl"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> My set-up is:
>>
>> Fedora Core 6
>> Apache/2.2.8
>> mod_jk 1.2.26
>> Tomcat  5.5.26
>> Cocoon 2.1.11
>> Sun JDK 1.6.0_05-b13
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
> 

-- 
Met vriendelijke groet,
Kind regards,

Jeroen Reijn

Hippo

Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646

www.onehippo.com info@onehippo.com


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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Rainer Pruy <Ra...@Acrys.COM>.
Hi Jed,

you might try using <map:match pattern="main/*.jhtml"> (leaving out the "/").
I remember having experienced similar problem some tim ago.

Regards
Rainer

Jed schrieb:
> Hi All,
> 
> I'm a new Cocoon user and I've come across and I'm having a really
> bizarre problem at the moment which has stopped my site development in
> it's tracks.
> 
> I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
> Cocoon samples running just fine. I've set-up a virtual server with
> it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
> test and again, those work both fine.
> 
> However, I've now started setting up my pipelines/matchers and a
> really strange thing is happening.
> 
> As a test, I've put "helloworld.xml" and its associated xsl file in
> docroot and set-up a matcher so that and request for /*.jhtml
> effectively loads and transforms that file. This works fine. However,
> if I then make a subdirectory of docroot and place the same xml/xsl
> there and set-up a matcher for that, absolutely nothing happens.
> Instead I just get a Tomcat 404 page.
> 
> I've been scratching my head over this for a week and what appears to
> be the problem is that Tomcat is definately passing requests for
> documents in docroot to cocoon but NOT for any sub-directories.
> 
> The way I tested was as follows:
> 
> Test 1:
> 
> Created files:
> docroot/helloworld.xml
> docroot/helloworld.xsl
> 
> Matcher:
> <map:match pattern="*.jhtml">
> <map:generate src="helloworld.xml"/>
> <map:transform src="helloworld.xsl"/>
> <map:serialize type="html"/>
> </map:match>
> 
> Request:
> http://test.domain/randomfilename.jhtml
> 
> Result:
> "Hello World!"
> 
> Test 2:
> 
> Create files:
> docroot/main/helloworld.xml
> docroot/main/helloworld.xsl
> 
> Matcher:
> <map:match pattern="/main/*.jhtml">
> <map:generate src="/main/helloworld.xml"/>
> <map:transform src="/main/helloworld.xsl"/>
> <map:serialize type="html"/>
> </map:match>
> 
> Request:
> http://test.domain/main/randomfilename.jhtml
> 
> Result:
> Tomcat 404 error message
> 
> Test 3:
> 
> Remove files:
> docroot/helloworld.xml
> docroot/helloworld.xsl
> 
> Matcher:
> <map:match pattern="*.jhtml">
> <map:generate src="helloworld.xml"/>
> <map:transform src="helloworld.xsl"/>
> <map:serialize type="html"/>
> </map:match>
> 
> Request:
> http://test.domain/randomfilename.jhtml
> 
> Result:
> Coccon 404 error message as defined in <map:handle-errors>
> 
> I have DEBUG level set in logkit and watched what was happening when I
> made requests. mod_jk was intercepting the request from apache and
> matching it with a worker and passing it to Tomcat. For requests for
> documents in docroot, Tomcat was passing them to cocoon as the
> requests and processing can be seen in the sitemap.log file.
> 
> However, when a request is made for a file in a sub-directory of
> docroot, there is zero activity in sitemap.log - the request just
> never gets there!
> 
> I am *completely* baffled. I believe I have the various components
> configured correctly but as stated, Tomcat will not pass requests for
> sub-dirs to Cocoon.
> 
> Can anyone shed any light on this?
> 
> - Jed
> 
> Heres the pertinent extracts from the various configs:
> 
> Apache - http.conf:
> 
> <VirtualHost *:80>
> DocumentRoot /usr/local/apache/share/saab_current/htdocs/
> ServerName test.domain
> Options FollowSymLinks +Indexes
> <Directory /usr/local/apache/share/htdocs>
> Options +Indexes
> </Directory>
> DirectoryIndex index.jhtml index.html index.xml
> JkMount /*.shtml xmlworker
> JkMount /main/*.jhtml xmlworker
> </VirtualHost>
> 
> Tomcat - server.xml
> <Engine name="Catalina" defaultHost="test.domain"
> cachingAllowed="true" debug="9">
> <Host name="test.domain" debug="9" appBase="/usr/local/apache/share/htdocs"
> unpackWARs="true" autoDeploy="true" xmlValidation="false"
> xmlNamespaceAware="false">
> <Context debug="9"
> reloadable="true"
> path=""
> docBase="/usr/local/apache/share/htdocs"
> />
> </Host>
> </Engine>
> 
> Tomcat - workers.properties
> 
> # XML worker
> worker.xmlworker.port=8009
> worker.xmlworker.host=localhost
> worker.xmlworker.type=ajp13
> 
> Cocoon - sitemap.xmap
> 
> <map:match pattern="*.jhtml">
> <map:generate src="pageOne.xml"/>
> <map:transform src="doc2html.xsl"/>
> <map:serialize type="html"/>
> </map:match>
> 
> <map:match pattern="/main/*.jhtml">
> <map:generate src="/main/pageTwo.xml"/>
> <map:transform src="/main/doc2html.xsl"/>
> <map:serialize type="html"/>
> </map:match>
> 
> My set-up is:
> 
> Fedora Core 6
> Apache/2.2.8
> mod_jk 1.2.26
> Tomcat  5.5.26
> Cocoon 2.1.11
> Sun JDK 1.6.0_05-b13
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
Rainer Pruy
Geschäftsführer

Acrys Consult GmbH & Co. KG
Untermainkai 29-30, D-60329 Frankfurt
Tel: +49-69-244506-0 - Fax: +49-69-244506-50
Web: http://www.acrys.com -  Email: office@acrys.com
Handelsregister: Frankfurt am Main, HRA 31151

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


RE: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jeroen Reijn <j....@onehippo.com>.
Thanks Jed for letting us know how you have solved your problem! Great
to hear that it's fixed!

Regards,

Jeroen

-----Original Message-----
From: neil.jed@gmail.com [mailto:neil.jed@gmail.com] On Behalf Of Jed
Sent: Thursday, April 10, 2008 10:16 PM
To: users@cocoon.apache.org
Subject: Re: Tomcat passing requests to cocoon for docroot, but not
sub-directories?

Well a follow up to say I fixed the problem. As I suspected it was a
problem with Tomcat, not Cocoon.

Short backstory, basically we had an existing web application using
older version of Tomcat/Cocoon and this was part of the process of
updating and moving everything to a newer faster environment.

We re-used a lot of the original configurations with some re-working
to remove deprecated elements and this where the error occured.

In Tomcats server.xml file, for the Host we had appBase defined as an
explicit path, as per the previous installation. This was set to
"/usr/local/share/apache/htdocs". Despite the documention saying you
*can* use an explicit path this seemed to be causing the problem.
Setting it to a zero length string seemed to solve the problem and now
everything appears to be working fine now.

I'll revisit the problem later on to check if this really is the
proper "fix" but for now it's working and we can carry on porting the
app.

- Jed



On 10/04/2008, Jed <ne...@gmail.com> wrote:
> Hi All,
>
>  I'm a new Cocoon user and I've come across and I'm having a really
>  bizarre problem at the moment which has stopped my site development
in
>  it's tracks.
>
>  I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
>  Cocoon samples running just fine. I've set-up a virtual server with
>  it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
>  test and again, those work both fine.
>
>  However, I've now started setting up my pipelines/matchers and a
>  really strange thing is happening.
>
>  As a test, I've put "helloworld.xml" and its associated xsl file in
>  docroot and set-up a matcher so that and request for /*.jhtml
>  effectively loads and transforms that file. This works fine. However,
>  if I then make a subdirectory of docroot and place the same xml/xsl
>  there and set-up a matcher for that, absolutely nothing happens.
>  Instead I just get a Tomcat 404 page.
>
>  I've been scratching my head over this for a week and what appears to
>  be the problem is that Tomcat is definately passing requests for
>  documents in docroot to cocoon but NOT for any sub-directories.
>
>  The way I tested was as follows:
>
>  Test 1:
>
>  Created files:
>  docroot/helloworld.xml
>  docroot/helloworld.xsl
>
>  Matcher:
>  <map:match pattern="*.jhtml">
>  <map:generate src="helloworld.xml"/>
>  <map:transform src="helloworld.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  Request:
>  http://test.domain/randomfilename.jhtml
>
>  Result:
>  "Hello World!"
>
>  Test 2:
>
>  Create files:
>  docroot/main/helloworld.xml
>  docroot/main/helloworld.xsl
>
>  Matcher:
>  <map:match pattern="/main/*.jhtml">
>  <map:generate src="/main/helloworld.xml"/>
>  <map:transform src="/main/helloworld.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  Request:
>  http://test.domain/main/randomfilename.jhtml
>
>  Result:
>  Tomcat 404 error message
>
>  Test 3:
>
>  Remove files:
>  docroot/helloworld.xml
>  docroot/helloworld.xsl
>
>  Matcher:
>  <map:match pattern="*.jhtml">
>  <map:generate src="helloworld.xml"/>
>  <map:transform src="helloworld.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  Request:
>  http://test.domain/randomfilename.jhtml
>
>  Result:
>  Coccon 404 error message as defined in <map:handle-errors>
>
>  I have DEBUG level set in logkit and watched what was happening when
I
>  made requests. mod_jk was intercepting the request from apache and
>  matching it with a worker and passing it to Tomcat. For requests for
>  documents in docroot, Tomcat was passing them to cocoon as the
>  requests and processing can be seen in the sitemap.log file.
>
>  However, when a request is made for a file in a sub-directory of
>  docroot, there is zero activity in sitemap.log - the request just
>  never gets there!
>
>  I am *completely* baffled. I believe I have the various components
>  configured correctly but as stated, Tomcat will not pass requests for
>  sub-dirs to Cocoon.
>
>  Can anyone shed any light on this?
>
>  - Jed
>
>  Heres the pertinent extracts from the various configs:
>
>  Apache - http.conf:
>
>  <VirtualHost *:80>
>  DocumentRoot /usr/local/apache/share/saab_current/htdocs/
>  ServerName test.domain
>  Options FollowSymLinks +Indexes
>  <Directory /usr/local/apache/share/htdocs>
>  Options +Indexes
>  </Directory>
>  DirectoryIndex index.jhtml index.html index.xml
>  JkMount /*.shtml xmlworker
>  JkMount /main/*.jhtml xmlworker
>  </VirtualHost>
>
>  Tomcat - server.xml
>  <Engine name="Catalina" defaultHost="test.domain"
>  cachingAllowed="true" debug="9">
>  <Host name="test.domain" debug="9"
appBase="/usr/local/apache/share/htdocs"
>  unpackWARs="true" autoDeploy="true" xmlValidation="false"
>  xmlNamespaceAware="false">
>  <Context debug="9"
>  reloadable="true"
>  path=""
>  docBase="/usr/local/apache/share/htdocs"
>  />
>  </Host>
>  </Engine>
>
>  Tomcat - workers.properties
>
>  # XML worker
>  worker.xmlworker.port=8009
>  worker.xmlworker.host=localhost
>  worker.xmlworker.type=ajp13
>
>  Cocoon - sitemap.xmap
>
>  <map:match pattern="*.jhtml">
>  <map:generate src="pageOne.xml"/>
>  <map:transform src="doc2html.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  <map:match pattern="/main/*.jhtml">
>  <map:generate src="/main/pageTwo.xml"/>
>  <map:transform src="/main/doc2html.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  My set-up is:
>
>  Fedora Core 6
>  Apache/2.2.8
>  mod_jk 1.2.26
>  Tomcat  5.5.26
>  Cocoon 2.1.11
>  Sun JDK 1.6.0_05-b13
>

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


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


Re: Tomcat passing requests to cocoon for docroot, but not sub-directories?

Posted by Jed <je...@wunderboy.org>.
Well a follow up to say I fixed the problem. As I suspected it was a
problem with Tomcat, not Cocoon.

Short backstory, basically we had an existing web application using
older version of Tomcat/Cocoon and this was part of the process of
updating and moving everything to a newer faster environment.

We re-used a lot of the original configurations with some re-working
to remove deprecated elements and this where the error occured.

In Tomcats server.xml file, for the Host we had appBase defined as an
explicit path, as per the previous installation. This was set to
"/usr/local/share/apache/htdocs". Despite the documention saying you
*can* use an explicit path this seemed to be causing the problem.
Setting it to a zero length string seemed to solve the problem and now
everything appears to be working fine now.

I'll revisit the problem later on to check if this really is the
proper "fix" but for now it's working and we can carry on porting the
app.

- Jed



On 10/04/2008, Jed <ne...@gmail.com> wrote:
> Hi All,
>
>  I'm a new Cocoon user and I've come across and I'm having a really
>  bizarre problem at the moment which has stopped my site development in
>  it's tracks.
>
>  I've got Apache/Tomcat/Cocoon set-up and have got the Tomcat and
>  Cocoon samples running just fine. I've set-up a virtual server with
>  it's own docroot and made a simple "HelloWorld" servlet and XML/XSLT
>  test and again, those work both fine.
>
>  However, I've now started setting up my pipelines/matchers and a
>  really strange thing is happening.
>
>  As a test, I've put "helloworld.xml" and its associated xsl file in
>  docroot and set-up a matcher so that and request for /*.jhtml
>  effectively loads and transforms that file. This works fine. However,
>  if I then make a subdirectory of docroot and place the same xml/xsl
>  there and set-up a matcher for that, absolutely nothing happens.
>  Instead I just get a Tomcat 404 page.
>
>  I've been scratching my head over this for a week and what appears to
>  be the problem is that Tomcat is definately passing requests for
>  documents in docroot to cocoon but NOT for any sub-directories.
>
>  The way I tested was as follows:
>
>  Test 1:
>
>  Created files:
>  docroot/helloworld.xml
>  docroot/helloworld.xsl
>
>  Matcher:
>  <map:match pattern="*.jhtml">
>  <map:generate src="helloworld.xml"/>
>  <map:transform src="helloworld.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  Request:
>  http://test.domain/randomfilename.jhtml
>
>  Result:
>  "Hello World!"
>
>  Test 2:
>
>  Create files:
>  docroot/main/helloworld.xml
>  docroot/main/helloworld.xsl
>
>  Matcher:
>  <map:match pattern="/main/*.jhtml">
>  <map:generate src="/main/helloworld.xml"/>
>  <map:transform src="/main/helloworld.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  Request:
>  http://test.domain/main/randomfilename.jhtml
>
>  Result:
>  Tomcat 404 error message
>
>  Test 3:
>
>  Remove files:
>  docroot/helloworld.xml
>  docroot/helloworld.xsl
>
>  Matcher:
>  <map:match pattern="*.jhtml">
>  <map:generate src="helloworld.xml"/>
>  <map:transform src="helloworld.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  Request:
>  http://test.domain/randomfilename.jhtml
>
>  Result:
>  Coccon 404 error message as defined in <map:handle-errors>
>
>  I have DEBUG level set in logkit and watched what was happening when I
>  made requests. mod_jk was intercepting the request from apache and
>  matching it with a worker and passing it to Tomcat. For requests for
>  documents in docroot, Tomcat was passing them to cocoon as the
>  requests and processing can be seen in the sitemap.log file.
>
>  However, when a request is made for a file in a sub-directory of
>  docroot, there is zero activity in sitemap.log - the request just
>  never gets there!
>
>  I am *completely* baffled. I believe I have the various components
>  configured correctly but as stated, Tomcat will not pass requests for
>  sub-dirs to Cocoon.
>
>  Can anyone shed any light on this?
>
>  - Jed
>
>  Heres the pertinent extracts from the various configs:
>
>  Apache - http.conf:
>
>  <VirtualHost *:80>
>  DocumentRoot /usr/local/apache/share/saab_current/htdocs/
>  ServerName test.domain
>  Options FollowSymLinks +Indexes
>  <Directory /usr/local/apache/share/htdocs>
>  Options +Indexes
>  </Directory>
>  DirectoryIndex index.jhtml index.html index.xml
>  JkMount /*.shtml xmlworker
>  JkMount /main/*.jhtml xmlworker
>  </VirtualHost>
>
>  Tomcat - server.xml
>  <Engine name="Catalina" defaultHost="test.domain"
>  cachingAllowed="true" debug="9">
>  <Host name="test.domain" debug="9" appBase="/usr/local/apache/share/htdocs"
>  unpackWARs="true" autoDeploy="true" xmlValidation="false"
>  xmlNamespaceAware="false">
>  <Context debug="9"
>  reloadable="true"
>  path=""
>  docBase="/usr/local/apache/share/htdocs"
>  />
>  </Host>
>  </Engine>
>
>  Tomcat - workers.properties
>
>  # XML worker
>  worker.xmlworker.port=8009
>  worker.xmlworker.host=localhost
>  worker.xmlworker.type=ajp13
>
>  Cocoon - sitemap.xmap
>
>  <map:match pattern="*.jhtml">
>  <map:generate src="pageOne.xml"/>
>  <map:transform src="doc2html.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  <map:match pattern="/main/*.jhtml">
>  <map:generate src="/main/pageTwo.xml"/>
>  <map:transform src="/main/doc2html.xsl"/>
>  <map:serialize type="html"/>
>  </map:match>
>
>  My set-up is:
>
>  Fedora Core 6
>  Apache/2.2.8
>  mod_jk 1.2.26
>  Tomcat  5.5.26
>  Cocoon 2.1.11
>  Sun JDK 1.6.0_05-b13
>

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