On Mon, 20 May 2002, [iso-8859-1] Jeremy Aston wrote:
> I've been racking my brain all weekend over a problem with SourceWriterTransformer
>(more likely my use of it actually). On C2.0.2, JDK1.3 everything works fine. I
>have now moved to 2.1-dev, JDK1.4 and my JDK1.4 compiled excalibur.
>SourceWriterTransformer now no longer works. It does do the source:insert stuff as
>per the Sunspot stuff but not source:write. It now throws various exceptions on the
>name of the file that it should write to as specified in the src attribute of the
>source:write element.
>
> I have tried different combinations in the sitemap including a generator and a
>serializer around the transformer but it makes no difference
>
> My source XML file is:
>
> <?xml version="1.0"?>
> <page xmlns:source="http://apache.org/cocoon/source/1.0">
> <source:write src="context://jez/jez.xml">
>
> I've tried it with the jez/jez.xml file created and not created but to no avail.
>This is strange because everything was working, creating files if they did not exist
>etc so I am getting just a little stumped. I have also tried different protocols
>(file://, context://) etc but they all just vary the exception thrown with the same
>basic message that the file cannot be found.
>
> If the file already exists (as zero length) then the error is:
>
> WARN (2002-05-20) 11:10.56:416 [sitemap.transformer.tofile](/xcpt/testwrite)
>HttpProcessor[8080][0]/SourceWritingTransformer: failed, The src attribute doesn't
>resolve to a writeable source
> java.lang.ClassCastException: org.apache.excalibur.source.impl.URLSource
I think only org.apache.cocoon.components.source.impl.FileSource
implements WriteableSource. So only file:// should work. If not perhaps,
you use the false SourceFactory.
You should have following entries in your xconf
<source-factories>
<!-- file protocol : this is a WriteableSource -->
<component-instance
class="org.apache.cocoon.components.source.impl.FileSourceFactory"
name="file"/>
</source-factories>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>