You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Phil Coultard <ph...@coultard.com> on 2003/03/30 14:04:25 UTC
Newbie: Ok I've got it installed but can't get a new stand alone application to run
Hi All,
Big thanks to Geoff Howard for his swift and fruitful reply to my last post.
I am just starting with Cocoon and I'm sorry to ask yet more what I'm sure
are stupid questions but...
Following Geoff's advice I have read the enclosed documentation and looked
on http://wiki.cocoondev.org. However both sources seem to concentrate on
the concepts and skip the more basic set-up procedures... Using these two
sources I have set up "work" as a sub-dir of mount and put in it two files:
sitemap.xmap and home.html, the source for which is shown below. When I
browse to http://localhost:8080/cocoon/mount/work/ I receive the following
message:
Cocoon 2 - Resource not found
----------------------------------------------------------------------------
----
type resource-not-found
message Resource not found
description The requested URI "/cocoon/mount/work/home.html" was not found.
sender org.apache.cocoon.servlet.CocoonServlet
source Cocoon servlet
request-uri
/cocoon/mount/work/home.html
path-info
mount/work/home.html
I can see that it clearly is getting as far as looking for the file
home.html in the root folder of the app but I don't understand why it
doesn't find it: it is there! Clearly I'm missing a point somewhere...
I am running:
Win 98
JDK 1.3.1
Tomcat 4.1.24
Cocoon 2.0.4
Cocoon runs ok: the examples work just fine.
Thanks in advance,
Kind Regards,
Phil Coultard
----------------------------------------------------------------------------
----
sitemap.xmap
----------------------------------------------------------------------------
----
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:generators default="file"/>
<map:transformers default="xslt"/>
<map:readers default="resource"/>
<map:serializers default="html"/>
<map:matchers default="wildcard"/>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="home.html"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
----------------------------------------------------------------------------
----
home.html
----------------------------------------------------------------------------
----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
Hi There!
</body>
</html>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.465 / Virus Database: 263 - Release Date: 25/03/03
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
RE: Newbie: Ok I've got it installed but can't get a new stand alone application to run
Posted by Geoff Howard <co...@leverageweb.com>.
> -----Original Message-----
> From: Phil Coultard [mailto:phil@coultard.com]
> Sent: Sunday, March 30, 2003 7:04 AM
> To: cocoon-users@xml.apache.org
> Subject: Newbie: Ok I've got it installed but can't get a new stand
> alone application to run
>
<snip/>
> Following Geoff's advice I have read the enclosed documentation and looked
> on http://wiki.cocoondev.org. However both sources seem to concentrate on
> the concepts and skip the more basic set-up procedures... Using these two
> sources I have set up "work" as a sub-dir of mount and put in it
> two files:
> sitemap.xmap and home.html, the source for which is shown below. When I
> browse to http://localhost:8080/cocoon/mount/work/ I receive the following
> message:
Ok, good way to get started playing around.
>
> Cocoon 2 - Resource not found
> ------------------------------------------------------------------
> type resource-not-found
> message Resource not found
> description The requested URI "/cocoon/mount/work/home.html" was
> not found.
> sender org.apache.cocoon.servlet.CocoonServlet
> source Cocoon servlet
> request-uri
> /cocoon/mount/work/home.html
> path-info
> mount/work/home.html
>
> I can see that it clearly is getting as far as looking for the file
> home.html in the root folder of the app but I don't understand why it
> doesn't find it: it is there! Clearly I'm missing a point somewhere...
Yes, see below.
> ------------------------------------------------------------------
> sitemap.xmap
> ------------------------------------------------------------------
> <?xml version="1.0"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>
> <map:components>
> <map:generators default="file"/>
> <map:transformers default="xslt"/>
> <map:readers default="resource"/>
> <map:serializers default="html"/>
> <map:matchers default="wildcard"/>
> </map:components>
>
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="">
> <map:redirect-to uri="home.html"/>
> </map:match>
<!-- You need a match for pattern="home.html". Cocoon never automatically
maps uris to actual resources on disk without an appropriate matcher. -->
<!-- read html and stream it directly, bypassing cocoon's sax
pipeline -->
<map:match pattern="home.html">
<map:read mime-type="text/html" src="home.html">
</map:match>
<!-- OR -->
<!-- parse html as xml using the file generator. you can add
transformer(s) and
serializer as you like here, but if your html is not well-formed xml,
the processing will fail -->
<map:match pattern="home.html">
<map:generate src="home.html"/>
<!--map:transform src="your_transform.xsl"/-->
<map:serialize/>
</map:match>
<!-- OR -->
<!-- use Tidy to parse html and make it well-formed xml -->
<map:match pattern="home.html">
<map:generate type="html" src="home.html"/>
<!--map:transform src="your_transform.xsl"/-->
<map:serialize/>
</map:match>
<!-- Note: to use pattern matching to serve all html in that dir in the same
way,
change the match to pattern="*.html" and use src="{1}.html" in your
generator/reader. -->
>
> </map:pipeline>
>
> </map:pipelines>
> </map:sitemap>
Hope that helps,
Geoff
>
> ------------------------------------------------------------------
> home.html
> ------------------------------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <html>
> <head>
> <title>Untitled</title>
> </head>
>
> <body>
> Hi There!
>
>
> </body>
> </html>
> ---
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org