cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: resource-exists but ResourceReader says Resource not found
Date Mon, 01 Dec 2003 23:41:52 GMT
> <map:act type="resource-exists">
>   <map:parameter name="url" value="{file}"/>
>   <map:read type="resource" src="{file}"/>
> </map:act>

The problem is in the third line above, it has to be {../file}. You 
change the context using map:act. But it must still be {file} in line 2 
as the map:parameter belongs to map:act, i.e. the context is not changed 
at this point. This is the same for all actions in Cocoon.

Joerg

On 01.12.2003 23:16, Tristan Lyons wrote:

> I'm new to Cocoon and am having trouble using ResourceReader to transmit a
> file resource to the client.
> 
> 
> The site is susposed to work 1 of 2 ways.
> 1. client loads URL
> http://localhost:8888/mySite/download?file=a-file-that-doesn't-exist.xml
> and gets the filenotfound html page.
> 2. client loads URL
> http://localhost:8888/mySite/download?file=a-file-that-does-exist.xml and
> the file is returned to the client with a resource reader.
> 
> My problem is that every time I request a file that does exist I get the
> error message,
> 
> "Resource not found
> 
> Error during resolving of the input stream
> 
> org.apache.cocoon.ResourceNotFoundException: Error during resolving of the
> input stream: org.apache.excalibur.source.SourceNotFoundException:
> file:/C:/cocoon-2.1.3/build/webapp/mySite/ doesn't exist.
> 
> cause: java.io.FileNotFoundException: C:\cocoon-2.1.3\build\webapp\mySite
> (Access is denied)
> 
> ..."
> 
> I double checked the ResourceReader here
> http://cocoon.apache.org/2.1/userdocs/readers/resource-reader.html and it
> looks like I'm doing this part right. Also the resource-exists Action says
> the resource does exist. I'm not sure what's wrong. I'm running cocoon-2.1.3
> on WindowsXP with the default servlet configuration.
> 
> If anyone knows what's wrong or has any suggestions I'd love to hear them.
> 
> 
> -Tristan
> (My sitemap.xmap is inlcuded below)
> 
> 
> <?xml version="1.0"?>
> <!-- CVS $Id: sitemap.xmap,v 1.2 2003/05/07 04:57:14 vgritsenko Exp $ -->
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> 
> 	<map:components>
> 		<map:generators default="file"/>
> 		<map:transformers default="xslt">
> 			<map:transformer name="log"
> src="org.apache.cocoon.transformation.LogTransformer"/>
> 		</map:transformers>
> 		<map:readers default="resource"/>
> 		<map:serializers default="html"/>
> 		<map:matchers default="wildcard"/>
> 		<map:selectors default="browser"/>
> 	</map:components>
> 	<!-- =========================== Pipelines
> ================================= -->
> 	<map:pipelines>
> 		<map:pipeline>
> 			<map:match pattern="download">
> 				<map:act type="request">
> 					<map:parameter name="parameters" value="true"/>
> 					<map:act type="resource-exists">
> 						<map:parameter name="url" value="{file}"/>
> 						<map:read type="resource" src="{file}"/>
> 					</map:act>
> 					<map:generate src="filenotfound.xml"/>
> 					<map:transform src="filenotfound2html.xsl"/>
> 					<map:serialize/>
> 				</map:act>
> 			</map:match>
> 
> 			<map:match pattern="store">
> 				<map:generate type="request">
> 					<map:parameter name="test" value="yes"/>
> 				</map:generate>
> 				<map:transform type="log">
> 					<map:parameter name="logfile" value="logfile.log"/>
> 					<map:parameter name="append" value="no"/>
> 				</map:transform>
> 				<map:serialize type="xml"/>
> 				</map:match>
> 		</map:pipeline>
> 	</map:pipelines>
> </map:sitemap>
> <!-- end of file -->
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message