forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <sju...@mac.com>
Subject Re: i18n/dispatcher: language selection contract
Date Fri, 15 Sep 2006 10:37:20 GMT
Den 15. sep. 2006 kl. 11.37 skrev Thorsten Scherler:

>> - the dataURI is looked up separately, and the returned data is
>> served as an argument (XML snippet) to the contract,
>
> well to be 100% correct: if a dataURI is defined this src is used  
> as the
> input doc to the xsl transformation (where the contract is the source
> for the xsl). The properties are parsed as parameter. If no dataURI is
> defined we create a <foo/> document in the dispatcher as input doc to
> trigger the transformation.

Ok, thanks for the clarification.

>>  From what I can see, it isn't able to resolve the stylesheet OR the
>> source document for some reason.
>
> The source document: "org.apache.excalibur.source.SourceException:
> Cannot get input stream for cocoon://index.languages.xml"
>
>
> What does localhost:8888/index.languages.xml return (this will be the
> testing url for the next steps)? Reading the dispatcherError I  
> guess it
> will return nothing.

It returned a similar error message:

Request URI

index.languages.xml
cause

/Users/sjur/Documents/i18n/sd/src/documentation (No such file or  
directory)


> To debug what exactly cannot be found try:
> <map:pipeline>
>        <map:match pattern="**.languages.xml">
>          <map:generate src="cocoon://{1}.xml" />
>          <map:serialize />
>        </map:match>
>      </map:pipeline>
>
> If this returns the document then the xsl cannot be found.

It does return the document, thus it is the XSL that cannot be found.

> To verify put
> again the xsl into the pipe and see the log. There should be then an
> exception telling you where cocoon tried to get the xsl from.

What I get is:

ERROR   (2006-09-15) 12:32.30:888   [access] (/index.languages.xml)  
PoolThread-1/CocoonServlet: Internal Cocoon Problem
org.apache.cocoon.ProcessingException: Unable to get transformer  
handler for file:/Users/sjur/Documents/i18n/sd/src/documentation/
         at <map:serialize> - file:/Users/sjur/Documents/i18n/sd/src/ 
documentation/sitemap.xmap:56:26
         at <map:transform> - file:/Users/sjur/Documents/i18n/sd/src/ 
documentation/sitemap.xmap:55:77
         at <map:generate> - file:/Users/sjur/Documents/i18n/sd/src/ 
documentation/sitemap.xmap:54:48
         at <map:mount> - file:/usr/local/forrest/main/webapp/ 
sitemap.xmap:396:48
         at org.apache.cocoon.transformation.TraxTransformer.setup 
(TraxTransformer.java:338)
         at  
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPi 
peline(AbstractProcessingPipeline.java:354)
         at  
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipe 
line.setupPipeline(AbstractCachingProcessingPipeline.java:614)
         at  
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.prepare 
Pipeline(AbstractProcessingPipeline.java:459)
         at  
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process 
(AbstractProcessingPipeline.java:409)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke( 
SerializeNode.java:137)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:55)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:116)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:77)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke 
(PipelineNode.java:155)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:77)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:292)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:223)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process 
(TreeProcessor.java:289)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke 
(MountNode.java:114)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:77)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke 
(SelectNode.java:81)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:77)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke 
(PipelineNode.java:155)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:77)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:292)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:223)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process 
(TreeProcessor.java:289)
         at org.apache.cocoon.Cocoon.process(Cocoon.java:557)
         at org.apache.cocoon.servlet.CocoonServlet.service 
(CocoonServlet.java:364)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.mortbay.jetty.servlet.ServletHolder.handle 
(ServletHolder.java:354)
         at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch 
(WebApplicationHandler.java:294)
         at org.mortbay.jetty.servlet.ServletHandler.handle 
(ServletHandler.java:567)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
         at org.mortbay.jetty.servlet.WebApplicationContext.handle 
(WebApplicationContext.java:525)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
         at org.mortbay.http.HttpServer.service(HttpServer.java:879)
         at org.mortbay.http.HttpConnection.service 
(HttpConnection.java:790)
         at org.mortbay.http.HttpConnection.handleNext 
(HttpConnection.java:952)
         at org.mortbay.http.HttpConnection.handle 
(HttpConnection.java:807)
         at org.mortbay.http.SocketListener.handleConnection 
(SocketListener.java:197)
         at org.mortbay.util.ThreadedServer.handle 
(ThreadedServer.java:289)
         at org.mortbay.util.ThreadPool$PoolThread.run 
(ThreadPool.java:501)
Caused by: org.apache.excalibur.xml.xslt.XSLTProcessorException:  
Exception when creating Transformer from file:/Users/sjur/Documents/ 
i18n/sd/src/documentation/
         at  
org.apache.cocoon.components.xslt.TraxProcessor.getTransformerHandlerAnd 
Validity(TraxProcessor.java:290)
         at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at  
org.apache.cocoon.core.container.handler.PoolableComponentHandler 
$ProxyHandler.invoke(PoolableComponentHandler.java:147)
         at $Proxy3.getTransformerHandlerAndValidity(Unknown Source)
         at org.apache.cocoon.transformation.TraxTransformer.setup 
(TraxTransformer.java:330)
         ... 40 more
Caused by: org.apache.excalibur.source.SourceNotFoundException: file:/ 
Users/sjur/Documents/i18n/sd/src/documentation/ doesn't exist.
         at org.apache.excalibur.source.impl.FileSource.getInputStream 
(FileSource.java:150)
         at  
org.apache.cocoon.components.xslt.TraxProcessor.sourceToSAX 
(TraxProcessor.java:298)
         at  
org.apache.cocoon.components.xslt.TraxProcessor.getTransformerHandlerAnd 
Validity(TraxProcessor.java:239)
         ... 46 more
Caused by: java.io.FileNotFoundException: /Users/sjur/Documents/i18n/ 
sd/src/documentation
(No such file or directory)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at org.apache.excalibur.source.impl.FileSource.getInputStream 
(FileSource.java:146)
         ... 48 more


> I normally do the
> cat ${exceptionLocation}

? Do you mean (in my case):

cat /Users/sjur/Documents/i18n/sd/src/documentation

> and see what is gives, if it returns something then try
>
> <map:pipeline>
>        <map:match pattern="**.languages.xml">
>          <map:generate src="{lm:dataModel-xml-document-to-
> languages.xsl}" />
>          <map:serialize />
>        </map:match>
>      </map:pipeline>
>
> If this works then the xsl itself maybe corrupt.

It doesn't work, it returns:

Message: Resource Not Found

Description: The requested resource "/index.languages.xml" could not  
be found

Sender: org.apache.cocoon.servlet.CocoonServlet


And in the log (core.log):

WARN    (2006-09-15) 12:38.53:058   [core.manager] (/ 
index.languages.xml) PoolThread-1/CoreServiceManager: disposing of  
handler for unreleased component. role  
[org.apache.cocoon.components.treeprocessor.ProcessorComponentInfo]
WARN    (2006-09-15) 12:38.53:083   [access] (/index.languages.xml)  
PoolThread-1/CocoonServlet: Resource not found.
         at <map:serialize> - file:/Users/sjur/Documents/i18n/sd/src/ 
documentation/sitemap.xmap:56:26
         at <map:generate> - file:/Users/sjur/Documents/i18n/sd/src/ 
documentation/sitemap.xmap:55:76
         at <map:mount> - file:/usr/local/forrest/main/webapp/ 
sitemap.xmap:396:48

Conclusion: the XSL can't be found. What should the locationmap entry

<location src="{properties:resources}stylesheets/xslt/xml/document-to- 
{1}.xsl"/>

be resolved to?

I eventually replaced the locationmap loookup in the project sitemap  
with the following:

         <map:transform src="{properties:resources.stylesheets}/ 
document-to-languages.xsl" />

and it was found. Bad thing I couldn't get the locationmap working.

Thanks for helping!

On to the next step:-)

Sjur


Mime
View raw message