You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Yan, Charlene" <Ch...@thomsonlearning.com> on 2003/06/02 21:51:48 UTC

jfor encoding problem

Hi everyone,

I'm trying to display accented characters correctly using jfor.  However, when I try to run http://localhost:8080/cocoon/samples/jfor/minimal.rtf, it gives the following exception.  I have put some French words such as "Gére" in the xml file.  Looks like it is a parser issue.  Anyone has any experience of this?  Thanks so much for your help!!

Charlene

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.

at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
	at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:318)
	at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:337)
	at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:198)
	at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:140)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:262)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:679)
	at org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:415)
	at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:193)
	at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:140)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:292)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:489)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:150)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:162)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:325)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:162)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:325)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:162)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:325)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:628)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1139)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
	at java.lang.Thread.run(Thread.java:484)


-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
Sent: Saturday, May 31, 2003 6:03 PM
To: cocoon-users@xml.apache.org
Subject: Re: Crashing on Generating Program Code


Hello Scott,

you must have read the wrong mails or forums ;-) This is the most 
annoying error using JDK 1.4 with anything related to XML, also known as 
"endorsed problem". The solution can be found at 
http://wiki.cocoondev.org/Wiki.jsp?page=Cocoon2.1DevSetupWin2000, issue 
no. 13 or at http://wiki.cocoondev.org/Wiki.jsp?page=NoMoreDtmIdError 
"The solution", because it's a similar reason for both issues.

Joerg

Scott McClure wrote:
> I have been unable to get any version of cocoon running except for 2.0.4 
> Binary dist. (my compiled version is always missing the lib directory 
> for some reason... I could just copy it in I guess) either way, When I 
> get it running, and I try to navigate to the main page I always get the 
> error listed below. I have seen this pop up in a few messages on fourms 
> before, but the problem was never answered.
...
> javax.xml.transform.TransformerException: 
> org.apache.xml.utils.WrappedRuntimeException: The output format must 
> have a '{http://xml.apache.org/xalan}content-handler' property!
>    at 
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2344) 
> 
>    at 
> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160) 
> 
>    at 
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213) 


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


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


RE: jfor encoding problem

Posted by Conal Tuohy <co...@paradise.net.nz>.
Charlene, it looks to me like your problem is not with jfor, but merely with
parsing the XML source file. 

The parser thinks the French text is encoded as UTF-8, but my guess is that
it actually uses ISO-8859-1. You should either open the XML file again and
save it in UTF-8 format, or add an encoding declaration to the start of the
file. e.g. <?xml version="1.0" encoding="ISO-8859-1"?> 

Cheers

Con

> -----Original Message-----
> From: Yan, Charlene [mailto:Charlene.Yan@thomsonlearning.com]
> Sent: Tuesday, 3 June 2003 07:52
> To: cocoon-users@xml.apache.org
> Subject: jfor encoding problem
> 
> 
> Hi everyone,
> 
> I'm trying to display accented characters correctly using 
> jfor.  However, when I try to run 
> http://localhost:8080/cocoon/samples/jfor/minimal.rtf, it 
> gives the following exception.  I have put some French words 
> such as "Gére" in the xml file.  Looks like it is a parser 
> issue.  Anyone has any experience of this?  Thanks so much 
> for your help!!

Re: jfor encoding problem

Posted by Bertrand Delacretaz <bd...@codeconsult.ch>.
Le Mardi, 3 juin 2003, à 07:40 Europe/Zurich, Bertrand Delacretaz a 
écrit :

> ...Is the encoding declaration correct in your input XML?

Sorry, didn't notice that this was answered already (but I had two 
other messages from the same person at my private address ;-)

-Bertrand

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


Re: jfor encoding problem

Posted by Bertrand Delacretaz <bd...@codeconsult.ch>.
Le Lundi, 2 juin 2003, à 21:51 Europe/Zurich, Yan, Charlene a écrit :

> ...
> I'm trying to display accented characters correctly using jfor.  
> However, when I try to run 
> http://localhost:8080/cocoon/samples/jfor/minimal.rtf, it gives the 
> following exception.  I have put some French words such as "Gére" in 
> the xml file...

Is the encoding declaration correct in your input XML?
Can you parse it with another tool (XML editor or parser)?

If you can reduce your input to the smallest XML file that causes the 
problem, you could post it here so that someone can test it.

Hope this helps,
--
   Bertrand Delacretaz (codeconsult.ch, jfor.org)
   XML, java, XSLT, Cocoon, FOP, mentoring/programming/teaching
   blogspace http://www.codeconsult.ch/bertrand


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