You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jesse Reynolds <li...@va.com.au> on 2002/08/11 15:33:21 UTC
RE: Sending a parameter to Xerces (allow java char encodings)
Hi Vadim et al
Okay, I've now edited JaxpParser.java, the diff's between the 2.0.2
version (same as the 2.0.3 version) and my modification is below.
But it doesn't work. What have I missed? Do I need to fix something
in cocoon.xconf? I've modified it in the 2.0.2 source. ... How can I
build a test to see if the xml parser is in fact getting the
allow-java-encodings feature turned on? Some XSP perhaps? (I am
really only assuming that Blackdown 1.2.2 JDK does support MacRoman,
because the Sun JDK 1.2.2 does and we do have a
$JAVA_HOME/jre/lib/i18n.jar file present, but this is an assumption
that I need to question... but my feeling is that the code i've
written into cocoon is probably just plain wrong...)
Thankyou
Jesse
bash-2.04# diff
./src/java/org/apache/cocoon/components/parser/JaxpParser.java.orig
./src/java/org/apache/cocoon/components/parser/JaxpParser.java
138a139,141
> /** do we want to allow all possible text encodings recognised
>by current JVM? */
> protected boolean allowJavaEncodings;
>
205a209,214
>
> // Pick up "allow-java-encodings" to allow the use of additional
> // character encodings supported by current JVM (eg "MacRoman")
> // Jesse Reynolds 2002.08.10
> this.allowJavaEncodings =
>params.getParameterAsBoolean("allow-java-encodings", true);
>
215a225,233
> }
>
> if (this.allowJavaEncodings) {
> try {
>
>this.reader.setFeature("http://xml.org/sax/features/allow-java-encodings",
>true);
> } catch (SAXException e) {
> getLogger().warn("SAX2 driver does not support
>feature: 'allow-java-encodings' "+
>
>"('http://xml.org/sax/features/allow-java-encodings')");
> }
The error is the same (or similar) as before:
org.xml.sax.SAXException: Stopping after fatal error: The encoding
"MacRoman" is not supported.
org.apache.cocoon.ProcessingException: Stopping after fatal error:
The encoding "MacRoman" is not supported.: org.xml.sax.SAXException:
Stopping after fatal error: The encoding "MacRoman" is not supported.
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.matchN10064(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.matchN10357(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java,
Compiled Code)
at org.apache.cocoon.Cocoon.process(Cocoon.java, Compiled Code)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java,
Compiled Code)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
org.xml.sax.SAXException: Stopping after fatal error: The encoding
"MacRoman" is not supported.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java,
Compiled Code)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java, Compiled
Code)
at
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java, Compiled
Code)
at
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java, Compiled
Code)
at
org.apache.cocoon.components.language.markup.LogicsheetCodeGenerator.generateCode(LogicsheetCodeGenerator.java,
Compiled Code)
at
org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.generateCode(AbstractMarkupLanguage.java,
Compiled Code)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java,
Compiled Code)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java,
Compiled Code)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java,
Compiled Code)
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.matchN10064(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.matchN10357(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java,
Compiled Code)
at org.apache.cocoon.Cocoon.process(Cocoon.java, Compiled Code)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java,
Compiled Code)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
Original exception : org.xml.sax.SAXException: Stopping after fatal
error: The encoding "MacRoman" is not supported.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java,
Compiled Code)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java, Compiled
Code)
at
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java, Compiled
Code)
at
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java, Compiled
Code)
at
org.apache.cocoon.components.language.markup.LogicsheetCodeGenerator.generateCode(LogicsheetCodeGenerator.java,
Compiled Code)
at
org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.generateCode(AbstractMarkupLanguage.java,
Compiled Code)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java,
Compiled Code)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java,
Compiled Code)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java,
Compiled Code)
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.matchN10064(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.matchN10357(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java,
Compiled Code)
at org.apache.cocoon.Cocoon.process(Cocoon.java, Compiled Code)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java,
Compiled Code)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
At 9:51 -0400 18/7/2002, Vadim Gritsenko wrote:
> > From: Jesse Reynolds [mailto:lizst@va.com.au]
>>
>> Hi
>>
>> I'm trying to get Xerces 2 (that comes with Cocoon 2.0.2) to parse
>> MacRoman encoded xml files.
>>
>> According to the Xerces FAQ
>> (http://xml.apache.org/xerces2-j/features.html) you can run the
>> following java code to tell it to recognise and process all character
>> encodings suppored by Java. The linux-jdk1.2.2 that I'm using does
>> support MacRoman encoded text, so this is, of course, what I want to
>> do:
>>
>>
>> import javax.xml.parsers.SAXParser;
>> import org.xml.sax.SAXException;
>> import org.xml.sax.XMLReader;
>>
>> SAXParser parser = /* created from SAXParserFactory */;
>> XMLReader reader = parser.getXMLReader();
>> try {
>>
>reader.setFeature("http://xml.org/sax/features/allow-java-encodings",
>> true);
>> }
>> catch (SAXException e) {
>> System.err.println("could not set parser feature");
>> }
>>
>>
>> Question is, how the hell to I tell Cocoon (or Tomcat????) to run
>> this Java code after loading the Xerces parser?
>
>Cocoon does not know about this feature ATM. If you don't mind, you can
>patch JaxpParser.java to take <allow-java-encodings/> configuration
>element and set this feature to the parser.
>
>Vadim
>
>
>> Is there any easier way to tell Xerces to allow java encodings, eg a
>> config file or something???
>>
>> Thanks very much
>>
>> Jesse
>>
>> --
>> Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
>>
>> Email: jesse (at) va.com.au > Website Development
>> Phone: +61 (0)8 8223 2288 > Web & Email Hosting
>> Web: http://jesse.va.com.au > Streaming Media Hosting
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings, eg
MacRoman )
Posted by Vadim Gritsenko <va...@verizon.net>.
Jesse Reynolds wrote:
> At 10:22 -0400 12/9/2002, Vadim Gritsenko wrote:
>
>> Jesse Reynolds wrote:
>>
>>> At 0:53 +1000 18/8/2002, Jesse Reynolds wrote:
>>>
>>>> OK! I've finally gotten this thing working in Cocoon 2.0.3!!!
>>>> Thanks for your assistance (and patience) Vadim.
>>>
>>>
>>>
>>> <snip>
>>>
>>> I have java-encodings working now for standard xml pages parsed by
>>> Cocoon, but alas XSP pages are not working.
>>>
>>> How can I find out what XML parser is being instantiated for XSP
>>> files? I've tried running unzip over all the .jar files in
>>> WEB-INF/lib of C2.0.3 but can't find any matches for the classes
>>> mentioned in the stacktrace near the error...
>>
>>
>>
>> See AbstractMarkupLanguage.java, generateCode() method. It
>> instantiates XMLReader there. If it is possible, it should better use
>> parser from component manager, and then your issue will be solved.
>
>
> Great, thanks Vadim.
>
> When you say "component manager", do you mean excalibur? Or what...?
this.manager.lookup(Parser.ROLE)
Vadim
> Thanks
>
> Jesse
>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings, eg
MacRoman )
Posted by Jesse Reynolds <li...@va.com.au>.
At 10:22 -0400 12/9/2002, Vadim Gritsenko wrote:
>Jesse Reynolds wrote:
>
>>At 0:53 +1000 18/8/2002, Jesse Reynolds wrote:
>>
>>>OK! I've finally gotten this thing working in Cocoon 2.0.3!!!
>>>Thanks for your assistance (and patience) Vadim.
>>
>>
>><snip>
>>
>>I have java-encodings working now for standard xml pages parsed by
>>Cocoon, but alas XSP pages are not working.
>>
>>How can I find out what XML parser is being instantiated for XSP
>>files? I've tried running unzip over all the .jar files in
>>WEB-INF/lib of C2.0.3 but can't find any matches for the classes
>>mentioned in the stacktrace near the error...
>
>
>See AbstractMarkupLanguage.java, generateCode() method. It
>instantiates XMLReader there. If it is possible, it should better
>use parser from component manager, and then your issue will be
>solved.
Great, thanks Vadim.
When you say "component manager", do you mean excalibur? Or what...?
Thanks
Jesse
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings, eg
MacRoman )
Posted by Vadim Gritsenko <va...@verizon.net>.
Jesse Reynolds wrote:
> At 0:53 +1000 18/8/2002, Jesse Reynolds wrote:
>
>> OK! I've finally gotten this thing working in Cocoon 2.0.3!!! Thanks
>> for your assistance (and patience) Vadim.
>
>
> <snip>
>
> I have java-encodings working now for standard xml pages parsed by
> Cocoon, but alas XSP pages are not working.
>
> How can I find out what XML parser is being instantiated for XSP
> files? I've tried running unzip over all the .jar files in WEB-INF/lib
> of C2.0.3 but can't find any matches for the classes mentioned in the
> stacktrace near the error...
See AbstractMarkupLanguage.java, generateCode() method. It instantiates
XMLReader there. If it is possible, it should better use parser from
component manager, and then your issue will be solved.
> ...
>
> Here is my test file "testxsp.xml":
>
> <?xml version="1.0" encoding="MacRoman"?>
> <xsp:page language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:util="http://apache.org/xsp/util/2.0"
> xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> xmlns:xsp-session="http://apache.org/xsp/session/2.0"
> create-session="yes">
> <page>
> <title>test MacRoman encoding</title>
> <heading>welcome - jesse's cocoon test</heading>
> <para>Okey dokey, this is some normal text.</para>
> <para>Here's some mac characters: ¥ * é ü </para>
> </page>
> </xsp:page>
>
> ....
>
> The entry in my sitemap for it is as follows:
>
> <map:pipeline>
> ...
> <map:match pattern="testxsp">
> <map:generate type="serverpages" src="testxsp.xml"/>
> <map:transform src="jesse_default.xsl"/>
> <map:serialize/>
> </map:match>
>
>
> The entire error message I receive is:
>
> Cocoon 2 - Internal server error
> ------------------------------------------------------------------------
>
> type fatal
>
> message Stopping after fatal error: The encoding "MacRoman" is not
> supported.
>
> description org.apache.cocoon.ProcessingException: Stopping after
> fatal error: The encoding "MacRoman" is not supported.:
> org.xml.sax.SAXException: Stopping after fatal error: The encoding
> "MacRoman" is not supported.
>
> sender org.apache.cocoon.servlet.CocoonServlet
>
> source Cocoon servlet
>
> stack-trace
...
> org.xml.sax.SAXException: Stopping after fatal error: The encoding
> "MacRoman" is not supported.
> at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1245)
> at
> org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:546)
>
> at
> org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314)
> at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
> at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
> at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
> at
> org.apache.cocoon.components.language.markup.LogicsheetCodeGenerator.generateCode(LogicsheetCodeGenerator.java:173)
>
> at
> org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.generateCode(AbstractMarkupLanguage.java:390)
>
Vadim
...
> request-uri
>
> /cocoon/jesse/testxsp
>
>
> path-info
>
> jesse/testxsp
>
>
>
> Thankyou!
>
> Jesse
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings, eg
MacRoman )
Posted by Jesse Reynolds <li...@va.com.au>.
At 0:53 +1000 18/8/2002, Jesse Reynolds wrote:
>OK! I've finally gotten this thing working in Cocoon 2.0.3!!! Thanks
>for your assistance (and patience) Vadim.
<snip>
I have java-encodings working now for standard xml pages parsed by
Cocoon, but alas XSP pages are not working.
How can I find out what XML parser is being instantiated for XSP
files? I've tried running unzip over all the .jar files in
WEB-INF/lib of C2.0.3 but can't find any matches for the classes
mentioned in the stacktrace near the error...
...
Here is my test file "testxsp.xml":
<?xml version="1.0" encoding="MacRoman"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:util="http://apache.org/xsp/util/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
create-session="yes">
<page>
<title>test MacRoman encoding</title>
<heading>welcome - jesse's cocoon test</heading>
<para>Okey dokey, this is some normal text.</para>
<para>Here's some mac characters: ¥ * é ü </para>
</page>
</xsp:page>
....
The entry in my sitemap for it is as follows:
<map:pipeline>
...
<map:match pattern="testxsp">
<map:generate type="serverpages" src="testxsp.xml"/>
<map:transform src="jesse_default.xsl"/>
<map:serialize/>
</map:match>
The entire error message I receive is:
Cocoon 2 - Internal server error
------------------------------------------------------------------------
type fatal
message Stopping after fatal error: The encoding "MacRoman" is not supported.
description org.apache.cocoon.ProcessingException: Stopping after
fatal error: The encoding "MacRoman" is not supported.:
org.xml.sax.SAXException: Stopping after fatal error: The encoding
"MacRoman" is not supported.
sender org.apache.cocoon.servlet.CocoonServlet
source Cocoon servlet
stack-trace
org.apache.cocoon.ProcessingException: Stopping after fatal error:
The encoding "MacRoman" is not supported.: org.xml.sax.SAXException:
Stopping after fatal error: The encoding "MacRoman" is not supported.
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:204)
at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:202)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:317)
at
org.apache.cocoon.www.jesse.sitemap_xmap.matchN10032(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/jesse/sitemap_xmap.java:551)
at
org.apache.cocoon.www.jesse.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/jesse/sitemap_xmap.java:380)
at
org.apache.cocoon.www.jesse.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/jesse/sitemap_xmap.java:321)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:224)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
at
org.apache.cocoon.www.sitemap_xmap.matchN10375(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:4033)
at
org.apache.cocoon.www.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3204)
at
org.apache.cocoon.www.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3112)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:224)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)
at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
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.valves.CertificatesValve.invoke(CertificatesValve.java:246)
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.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:496)
org.xml.sax.SAXException: Stopping after fatal error: The encoding
"MacRoman" is not supported.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1245)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:546)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at
org.apache.cocoon.components.language.markup.LogicsheetCodeGenerator.generateCode(LogicsheetCodeGenerator.java:173)
at
org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.generateCode(AbstractMarkupLanguage.java:390)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:370)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:333)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:292)
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:198)
at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:202)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:317)
at
org.apache.cocoon.www.jesse.sitemap_xmap.matchN10032(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/jesse/sitemap_xmap.java:551)
at
org.apache.cocoon.www.jesse.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/jesse/sitemap_xmap.java:380)
at
org.apache.cocoon.www.jesse.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/jesse/sitemap_xmap.java:321)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:224)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
at
org.apache.cocoon.www.sitemap_xmap.matchN10375(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:4033)
at
org.apache.cocoon.www.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3204)
at
org.apache.cocoon.www.sitemap_xmap.process(/usr/local/jakarta-tomcat-4.0.4/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3112)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:224)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)
at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
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.valves.CertificatesValve.invoke(CertificatesValve.java:246)
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.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:496)
request-uri
/cocoon/jesse/testxsp
path-info
jesse/testxsp
Thankyou!
Jesse
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings, eg
MacRoman )
Posted by Jesse Reynolds <li...@va.com.au>.
OK! I've finally gotten this thing working in Cocoon 2.0.3!!! Thanks
for your assistance (and patience) Vadim.
So now I can have a document with XML Decln: <?xml version="1.0"
encoding="MacRoman"?> and Cocoon will now read it, and interpret the
characters properly.
I modified the Avalon Excalibur JaxpParser.java from April 2002 (v1.1
in CVS) and it overrides the JaxpParser.class in
avalon-excalibur-vm12-20020705.jar which ships with Cocoon 2.0.3.
Here is a diff... note there are some debug lines that need removing,
and perhaps it should leave allow-java-encodings as "false" by
default, not sure... anyway, here it is.
Perhaps this change could be incorporated into Excalibur for the
benefit of anyone else who wants to parse "weird" character
encodings???
Cheers
Jesse
[localhost:avalon/excalibur/xml] root# diff -b -B -c
JaxpParser-apr02.java JaxpParser.java
*** JaxpParser-apr02.java Sat Aug 17 23:14:51 2002
--- JaxpParser.java Sat Aug 17 23:23:20 2002
***************
*** 1,3 ****
--- 1,10 ----
+
+ /*
+ * Downloaded from
http://cvs.apache.org/viewcvs.cgi/-checkout-/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java?rev=1.1&search=None&hideattic=1
+ * at 23:15 17/8/2002 Adelaide Time by Jesse
+ */
+
+
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
***************
*** 5,10 ****
--- 12,18 ----
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
+
package org.apache.avalon.excalibur.xml;
import java.io.IOException;
***************
*** 108,113 ****
--- 116,124 ----
/** do we stop on recoverable errors ? */
protected boolean stopOnRecoverableError;
+ /** do we want to allow all possible text encodings recognised
by current JVM? */
+ protected boolean allowJavaEncodings;
+
/**
* Get the Entity Resolver from the component manager
*/
***************
*** 131,136 ****
--- 142,148 ----
public void parameterize( Parameters params )
throws ParameterException
{
+ System.out.println("Jesse Debug: in avalon JaxpParser.java,
class JaxpParser.parameterize");
// Validation and namespace prefixes parameters
boolean validate = params.getParameterAsBoolean( "validate", false );
this.nsPrefixes = params.getParameterAsBoolean(
"namespace-prefixes", false );
***************
*** 182,187 ****
--- 194,206 ----
this.docFactory.setNamespaceAware( true );
this.docFactory.setValidating( validate );
+ // Pick up "allow-java-encodings" to allow the use of additional
+ // character encodings supported by current JVM (eg "MacRoman")
+ // Jesse Reynolds 2002.08.10
+ this.allowJavaEncodings =
params.getParameterAsBoolean("allow-java-encodings", true);
+ System.out.println( "JESSE DEBUG: allow-java-encodings has
been set to: " + this.allowJavaEncodings );
+
+
if( this.getLogger().isDebugEnabled() )
{
this.getLogger().debug( "JaxpParser: validating: " + validate +
***************
*** 190,196 ****
", stop on warning: " +
this.stopOnWarning +
", stop on recoverable-error: "
+ this.stopOnRecoverableError +
", saxParserFactory: " +
saxParserFactoryName +
! ", documentBuilderFactory: " +
documentBuilderFactoryName );
}
}
--- 209,216 ----
", stop on warning: " +
this.stopOnWarning +
", stop on recoverable-error: "
+ this.stopOnRecoverableError +
", saxParserFactory: " +
saxParserFactoryName +
! ", documentBuilderFactory: " +
documentBuilderFactoryName +
! ", allow-java-encodings: " +
this.allowJavaEncodings );
}
}
***************
*** 257,262 ****
--- 277,291 ----
{
this.getLogger().warn( "SAX2 driver does not support
property: " +
"'http://xml.org/sax/properties/lexical-handler'" );
+ }
+
+ if (this.allowJavaEncodings) {
+ try {
+
tmpReader.setFeature("http://apache.org/xml/features/allow-java-encodings",
true);
+ } catch (SAXException e) {
+ this.getLogger().warn("SAX2 driver does not support
feature: 'allow-java-encodings' "+
+
"('http://apache.org/xml/features/allow-java-encodings')");
+ }
}
tmpReader.setErrorHandler( this );
[localhost:avalon/excalibur/xml] root#
At 0:21 -0400 17/8/2002, Vadim Gritsenko wrote:
>Jesse Reynolds wrote:
>
>...
>
>>OK! Now we're getting somewhere. All my debug output is now
>>happening, YAY, but now cocoon is not initialising. Hmmmm. I must
>>have stuffed up the code I guess, I will review...
>>
>>What version of Excalibur is shipped with Cocoon 2.0.2???
>
>
>See jar name. Usually it is some dated version (use cvs co -D...)
>Current 2.0.4-dev is: avalon-excalibur-vm12-20020705.jar.
>
>>>From core.log:
>>
>>java.lang.NullPointerException
>> at
>>org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:287)
>> at
>>org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:246)
>
>
>Seems like NPE in your version of parser. Take a version matching
>with your Cocoon.
>
>Vadim
>
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Vadim Gritsenko <va...@verizon.net>.
Jesse Reynolds wrote:
...
> OK! Now we're getting somewhere. All my debug output is now happening,
> YAY, but now cocoon is not initialising. Hmmmm. I must have stuffed up
> the code I guess, I will review...
>
> What version of Excalibur is shipped with Cocoon 2.0.2???
See jar name. Usually it is some dated version (use cvs co -D...)
Current 2.0.4-dev is: avalon-excalibur-vm12-20020705.jar.
> From core.log:
>
> java.lang.NullPointerException
> at
> org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:287)
> at
> org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:246)
Seems like NPE in your version of parser. Take a version matching with
your Cocoon.
Vadim
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Jesse Reynolds <li...@va.com.au>.
>>
>>Hi Vadim
>>
>>Okay, I've modified the JaxpParser.java and placed it at:
>>
>>$TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java
>
>
>
>Ahem...
>
>Take a look at "package ..." line in the source code. *This* line
>should match directory, not URL from CVS. It should be (after
>compilation!!!):
>
>$TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/org/apache/avalon/excalibur/xml/JaxpParser.class
OK! Now we're getting somewhere. All my debug output is now
happening, YAY, but now cocoon is not initialising. Hmmmm. I must
have stuffed up the code I guess, I will review...
What version of Excalibur is shipped with Cocoon 2.0.2???
From core.log:
java.lang.NullPointerException
at
org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:287)
at
org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:246)
at org.apache.cocoon.Cocoon.configure(Cocoon.java:327)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:265)
at
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1214)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:409)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:918)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:478)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:738)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
Cheers
Jesse
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Vadim Gritsenko <va...@verizon.net>.
Jesse Reynolds wrote:
> At 22:29 -0400 15/8/2002, Vadim Gritsenko wrote:
>
>> Jesse Reynolds wrote:
>>
>>> At 22:10 -0400 15/8/2002, Vadim Gritsenko wrote:
>>>
>>>> Jesse Reynolds wrote:
>>>>
>>>>>
>>>>> And I've made the changes to JaxpParser.java as Vadim has
>>>>> suggested to get it to tell Xerces to "allow-java-encodings" but
>>>>> it just doesn't seem to work.
>>>>>
>>>>> Perhaps a bug in Xerces?
>>>>
>
> ...
>
>>> So, what should I try adding the allow-java-encodings code to now do
>>> you think? I can't see any other file called JaxpParser.java in the
>>> source, so does this mean I have to edit the source code of Avalon
>>> XML Parser or something?
>>
>>
>>
>> :)
>>
>> You've got this part right. But it's not Avalon XML Parser, it's
>> Avalon XML Parser Component which wraps JAXP parser into Component.
>>
>> Source is located at:
>>
>> http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java?rev=1.3&content-type=text/vnd.viewcvs-markup
>>
>>
>> You don't have to compile all Excalibur, you can just patch and
>> compile this class (add some System.out.println to see what's going
>> on!) and put it under webapp/WEB-INF/classes/org/apache/..., and it
>> will be loaded from there before old class.
>
>
> Hi Vadim
>
> Okay, I've modified the JaxpParser.java and placed it at:
>
> $TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java
Ahem...
Take a look at "package ..." line in the source code. *This* line should
match directory, not URL from CVS. It should be (after compilation!!!):
$TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/org/apache/avalon/excalibur/xml/JaxpParser.class
> and have compiled it so there is a JaxpParser.class in the same dir.
>
> I've strewn it with copious System.out.println("debug..."); lines but
> none of them are reaching the catalina.out file. As a test I put a
> println into CocoonServlet.java and recompiled Cocoon and this debug
> line DOES appear in catalina.out, so I'm sure I know where I should be
> looking for the debug output...
>
> It would appear that Cocoon is not finding my new JaxpParser.class file.
>
> How can I be sure about this... and how can I rectify the situation so
> it is loading it before the main excalibur jars?
It *will* load it before jars in WEB-INF/lib.
Vadim
> Thanks
>
> Jesse
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Jesse Reynolds <li...@va.com.au>.
At 22:29 -0400 15/8/2002, Vadim Gritsenko wrote:
>Jesse Reynolds wrote:
>
>>At 22:10 -0400 15/8/2002, Vadim Gritsenko wrote:
>>
>>>Jesse Reynolds wrote:
>>>
>>>>
>>>>And I've made the changes to JaxpParser.java as Vadim has
>>>>suggested to get it to tell Xerces to "allow-java-encodings" but
>>>>it just doesn't seem to work.
>>>>
>>>>Perhaps a bug in Xerces?
...
>>So, what should I try adding the allow-java-encodings code to now
>>do you think? I can't see any other file called JaxpParser.java in
>>the source, so does this mean I have to edit the source code of
>>Avalon XML Parser or something?
>
>
>:)
>
>You've got this part right. But it's not Avalon XML Parser, it's
>Avalon XML Parser Component which wraps JAXP parser into Component.
>
>Source is located at:
>
>http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java?rev=1.3&content-type=text/vnd.viewcvs-markup
>
>You don't have to compile all Excalibur, you can just patch and
>compile this class (add some System.out.println to see what's going
>on!) and put it under webapp/WEB-INF/classes/org/apache/..., and it
>will be loaded from there before old class.
Hi Vadim
Okay, I've modified the JaxpParser.java and placed it at:
$TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java
and have compiled it so there is a JaxpParser.class in the same dir.
I've strewn it with copious System.out.println("debug..."); lines but
none of them are reaching the catalina.out file. As a test I put a
println into CocoonServlet.java and recompiled Cocoon and this debug
line DOES appear in catalina.out, so I'm sure I know where I should
be looking for the debug output...
It would appear that Cocoon is not finding my new JaxpParser.class file.
How can I be sure about this... and how can I rectify the situation
so it is loading it before the main excalibur jars?
Thanks
Jesse
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Jesse Reynolds <li...@va.com.au>.
At 22:29 -0400 15/8/2002, Vadim Gritsenko wrote:
>Jesse Reynolds wrote:
>
>>At 22:10 -0400 15/8/2002, Vadim Gritsenko wrote:
>>
>>>Jesse Reynolds wrote:
>>>
>>>>
>>>>And I've made the changes to JaxpParser.java as Vadim has
>>>>suggested to get it to tell Xerces to "allow-java-encodings" but
>>>>it just doesn't seem to work.
>>>>
>>>>Perhaps a bug in Xerces?
>>>
>>>
>>>
>>>Jesse,
>>>
>>>Please note: you have patched
>>>org/apache/cocoon/components/parser/JaxpParser.java file, but
>>>stack trace shows org.apache.avalon.excalibur.xml.JaxpParser
>>>class.
>>>
>>>As you can see in org.apache.cocoon.components.parser.Parser:
>>>* @deprecated The Avalon XML Parser is now used inside Cocoon. This role
>>>* will be removed in future releases.
>>>
>>>
>>>Vadim
>>
>>
>>
>>Thanks Vadim!
>>
>>I was wondering about that, but not being a seasoned java developer
>>I wasn't 100% on whether the class path should equal the sourcecode
>>path. Now I know :-)
>>
>>So, what should I try adding the allow-java-encodings code to now
>>do you think? I can't see any other file called JaxpParser.java in
>>the source, so does this mean I have to edit the source code of
>>Avalon XML Parser or something?
>
>
>:)
>
>You've got this part right. But it's not Avalon XML Parser, it's
>Avalon XML Parser Component which wraps JAXP parser into Component.
>
>Source is located at:
>
>http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java?rev=1.3&content-type=text/vnd.viewcvs-markup
>
>You don't have to compile all Excalibur, you can just patch and
>compile this class (add some System.out.println to see what's going
>on!) and put it under webapp/WEB-INF/classes/org/apache/..., and it
>will be loaded from there before old class.
>
>
>How come Xerces still appears in the stacktrace if we're no longer
>using it or is Avalon not actually a parser, just something like a
>different wrapper for Xerces or whatever?
>
>
>Mentioned Component will instantiate available JAXP parser and use
>it. You can see it in the source code you were patching (piece
>
>factory.newSAXParser().getXMLReader() instantiates Xerces).
>
>.
>
>Vadim
Awesome! Thanks Vadim. I'll give it a go and report back.
Regards
Jesse
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Vadim Gritsenko <va...@verizon.net>.
Jesse Reynolds wrote:
> At 22:10 -0400 15/8/2002, Vadim Gritsenko wrote:
>
>> Jesse Reynolds wrote:
>>
>>>
>>> And I've made the changes to JaxpParser.java as Vadim has suggested
>>> to get it to tell Xerces to "allow-java-encodings" but it just
>>> doesn't seem to work.
>>>
>>> Perhaps a bug in Xerces?
>>
>>
>>
>> Jesse,
>>
>> Please note: you have patched
>> org/apache/cocoon/components/parser/JaxpParser.java file, but stack
>> trace shows org.apache.avalon.excalibur.xml.JaxpParser class.
>>
>> As you can see in org.apache.cocoon.components.parser.Parser:
>> * @deprecated The Avalon XML Parser is now used inside Cocoon. This role
>> * will be removed in future releases.
>>
>>
>> Vadim
>
>
>
> Thanks Vadim!
>
> I was wondering about that, but not being a seasoned java developer I
> wasn't 100% on whether the class path should equal the sourcecode
> path. Now I know :-)
>
> So, what should I try adding the allow-java-encodings code to now do
> you think? I can't see any other file called JaxpParser.java in the
> source, so does this mean I have to edit the source code of Avalon XML
> Parser or something?
:)
You've got this part right. But it's not Avalon XML Parser, it's Avalon
XML Parser Component which wraps JAXP parser into Component.
Source is located at:
http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/Attic/JaxpParser.java?rev=1.3&content-type=text/vnd.viewcvs-markup
You don't have to compile all Excalibur, you can just patch and compile
this class (add some System.out.println to see what's going on!) and put
it under webapp/WEB-INF/classes/org/apache/..., and it will be loaded
from there before old class.
> How come Xerces still appears in the stacktrace if we're no longer
> using it or is Avalon not actually a parser, just something like a
> different wrapper for Xerces or whatever?
Mentioned Component will instantiate available JAXP parser and use it.
You can see it in the source code you were patching (piece
factory.newSAXParser().getXMLReader() instantiates Xerces).
.
Vadim
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Jesse Reynolds <li...@va.com.au>.
At 22:10 -0400 15/8/2002, Vadim Gritsenko wrote:
>Jesse Reynolds wrote:
>>
>>And I've made the changes to JaxpParser.java as Vadim has suggested
>>to get it to tell Xerces to "allow-java-encodings" but it just
>>doesn't seem to work.
>>
>>Perhaps a bug in Xerces?
>
>
>Jesse,
>
>Please note: you have patched
>org/apache/cocoon/components/parser/JaxpParser.java file, but stack
>trace shows org.apache.avalon.excalibur.xml.JaxpParser class.
>
>As you can see in org.apache.cocoon.components.parser.Parser:
>* @deprecated The Avalon XML Parser is now used inside Cocoon. This role
>* will be removed in future releases.
>
>
>Vadim
Thanks Vadim!
I was wondering about that, but not being a seasoned java developer I
wasn't 100% on whether the class path should equal the sourcecode
path. Now I know :-)
So, what should I try adding the allow-java-encodings code to now do
you think? I can't see any other file called JaxpParser.java in the
source, so does this mean I have to edit the source code of Avalon
XML Parser or something?
How come Xerces still appears in the stacktrace if we're no longer
using it or is Avalon not actually a parser, just something like a
different wrapper for Xerces or whatever?
Thankyou
Jesse
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Sending a parameter to Xerces (allow java char encodings)
Posted by Vadim Gritsenko <va...@verizon.net>.
Jesse Reynolds wrote:
> At 11:07 -0400 12/8/2002, Vadim Gritsenko wrote:
>
>> > From: Jesse Reynolds [mailto:lizst@va.com.au]
>>
>>>
>>> Thanks Vadim
>>>
>>> I've changed the code to mention the correct URL, but it is still not
>>> working. I am confused about why it isn't working. Either:
>>>
>>> a) My code is not doing the right thing
>>> b) Xerces has a bug
>>> c) I need to make a similar change to another piece of code in
>>> cocoon as well
>>
>> > Any suggestions?
>
>
>
> Okay, because i copied the sitemap from the samples and not copied the
> common dir over too. Having done that, now I'm just gettng a prettier
> "unsupported encoding" message.
>
> I know my JVM supports MacRoman encoded characters, as I've written
> some test java code and it works perfectly.
>
> And I've made the changes to JaxpParser.java as Vadim has suggested to
> get it to tell Xerces to "allow-java-encodings" but it just doesn't
> seem to work.
>
> Perhaps a bug in Xerces?
Jesse,
Please note: you have patched
org/apache/cocoon/components/parser/JaxpParser.java file, but stack
trace shows org.apache.avalon.excalibur.xml.JaxpParser class.
As you can see in org.apache.cocoon.components.parser.Parser:
* @deprecated The Avalon XML Parser is now used inside Cocoon. This role
* will be removed in future releases.
Vadim
> Or is there somewhere else in Cocoon that I need to fix this perhaps?
>
> the diff of JaxpParser.java once again:
>
>
> bash-2.04# diff
> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java.orig
> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java
> 138a139,141
>
>> /** do we want to allow all possible text encodings recognised
>> by current JVM? */
>> protected boolean allowJavaEncodings;
>>
> 205a209,214
>
>> // Pick up "allow-java-encodings" to allow the use of
>> additional
>> // character encodings supported by current JVM (eg
>> "MacRoman")
>> // Jesse Reynolds 2002.08.10
>> this.allowJavaEncodings =
>> params.getParameterAsBoolean("allow-java-encodings", true);
>>
> 215a225,233
>
>> }
>> if (this.allowJavaEncodings) {
>> try {
>>
>> this.reader.setFeature("http://xml.org/sax/features/allow-java-encodings",
>> true);
>> } catch (SAXException e) {
>> getLogger().warn("SAX2 driver does not support
>> feature: 'allow-java-encodings' "+
>>
>> "('http://xml.org/sax/features/allow-java-encodings')");
>> }
>
>
>
>
> and the full output of sitemap.log when requesting a very simple page
> with encoding="MacRoman" in the XML decln:
>
>
> DEBUG (2002-08-16) 08:08.56:177 [sitemap.generator.file]
> (/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/FileGenerator:
> processing file wonka.xml
> DEBUG (2002-08-16) 08:08.56:179 [sitemap.generator.file]
> (/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/FileGenerator: file
> resolved to
> file:/usr/local/jakarta-tomcat-4.0.4/webapps/cocoon/afringe/wonka.xml
> DEBUG (2002-08-16) 08:08.56:185 [sitemap.generator.file]
> (/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/FileGenerator: Got
> SAXException; Rethrowing cause exception
> org.xml.sax.SAXParseException: The encoding "MacRoman" is not supported.
> at
> org.apache.avalon.excalibur.xml.JaxpParser.fatalError(JaxpParser.java,
> Compiled Code)
> at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java,
> Compiled Code)
> at
> org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java,
> Compiled Code)
> at
> org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java,
> Compiled Code)
> at org.apache.xerces.framework.XMLParser.parse(XMLParser.java,
> Compiled Code)
> at
> org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java,
> Compiled Code)
> at
> org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java,
> Compiled Code)
> at
> org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java,
> Compiled Code)
> at
> org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java,
> Compiled Code)
> at
> org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java,
> Compiled Code)
> at
> org.apache.cocoon.www.afringe.sitemap_xmap.matchN10064(sitemap_xmap.java,
> Compiled Code)
> at
> org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
> Compiled Code)
> at
> org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
> Compiled Code)
> at org.apache.cocoon.sitemap.Handler.process(Handler.java,
> Compiled Code)
> at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
> Compiled Code)
> at
> org.apache.cocoon.www.sitemap_xmap.matchN10357(sitemap_xmap.java,
> Compiled Code)
> at
> org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java, Compiled
> Code)
> at
> org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java, Compiled
> Code)
> at org.apache.cocoon.sitemap.Handler.process(Handler.java,
> Compiled Code)
> at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
> Compiled Code)
> at
> org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java,
> Compiled Code)
> at org.apache.cocoon.Cocoon.process(Cocoon.java, Compiled Code)
> at
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java,
> Compiled Code)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> Compiled Code)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java,
> Compiled Code)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
> Compiled Code)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
> Compiled Code)
> at
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java,
> Compiled Code)
> at
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java,
> Compiled Code)
> at java.lang.Thread.run(Thread.java, Compiled Code)
> DEBUG (2002-08-16) 08:08.57:562 [sitemap.transformer.xslt]
> (/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/TraxTransformer:
> Using stylesheet:
> 'file:/usr/local/jakarta-tomcat-4.0.4/webapps/cocoon/afringe/error2html.xsl'
> in org.apache.cocoon.transformation.TraxTransformer@bc22685d, last
> modified: 998973544000
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Sending a parameter to Xerces (allow java char encodings)
Posted by Jesse Reynolds <li...@va.com.au>.
At 11:07 -0400 12/8/2002, Vadim Gritsenko wrote:
> > From: Jesse Reynolds [mailto:lizst@va.com.au]
>>
>> Thanks Vadim
>>
>> I've changed the code to mention the correct URL, but it is still not
>> working. I am confused about why it isn't working. Either:
>>
>> a) My code is not doing the right thing
>> b) Xerces has a bug
>> c) I need to make a similar change to another piece of code in cocoon
>as well.
>>
> > Any suggestions?
Okay, because i copied the sitemap from the samples and not copied
the common dir over too. Having done that, now I'm just gettng a
prettier "unsupported encoding" message.
I know my JVM supports MacRoman encoded characters, as I've written
some test java code and it works perfectly.
And I've made the changes to JaxpParser.java as Vadim has suggested
to get it to tell Xerces to "allow-java-encodings" but it just
doesn't seem to work.
Perhaps a bug in Xerces?
Or is there somewhere else in Cocoon that I need to fix this perhaps?
the diff of JaxpParser.java once again:
bash-2.04# diff
./src/java/org/apache/cocoon/components/parser/JaxpParser.java.orig
./src/java/org/apache/cocoon/components/parser/JaxpParser.java
138a139,141
> /** do we want to allow all possible text encodings recognised
>by current JVM? */
> protected boolean allowJavaEncodings;
>
205a209,214
>
> // Pick up "allow-java-encodings" to allow the use of additional
> // character encodings supported by current JVM (eg "MacRoman")
> // Jesse Reynolds 2002.08.10
> this.allowJavaEncodings =
>params.getParameterAsBoolean("allow-java-encodings", true);
>
215a225,233
> }
>
> if (this.allowJavaEncodings) {
> try {
>
>this.reader.setFeature("http://xml.org/sax/features/allow-java-encodings",
>true);
> } catch (SAXException e) {
> getLogger().warn("SAX2 driver does not support
>feature: 'allow-java-encodings' "+
>
>"('http://xml.org/sax/features/allow-java-encodings')");
> }
and the full output of sitemap.log when requesting a very simple page
with encoding="MacRoman" in the XML decln:
DEBUG (2002-08-16) 08:08.56:177 [sitemap.generator.file]
(/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/FileGenerator:
processing file wonka.xml
DEBUG (2002-08-16) 08:08.56:179 [sitemap.generator.file]
(/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/FileGenerator:
file resolved to
file:/usr/local/jakarta-tomcat-4.0.4/webapps/cocoon/afringe/wonka.xml
DEBUG (2002-08-16) 08:08.56:185 [sitemap.generator.file]
(/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/FileGenerator: Got
SAXException; Rethrowing cause exception
org.xml.sax.SAXParseException: The encoding "MacRoman" is not supported.
at
org.apache.avalon.excalibur.xml.JaxpParser.fatalError(JaxpParser.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java,
Compiled Code)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java,
Compiled Code)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java, Compiled
Code)
at
org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java,
Compiled Code)
at
org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractStreamSource.java,
Compiled Code)
at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java,
Compiled Code)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.matchN10064(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.afringe.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.matchN10357(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java,
Compiled Code)
at org.apache.cocoon.sitemap.Handler.process(Handler.java,
Compiled Code)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java,
Compiled Code)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java,
Compiled Code)
at org.apache.cocoon.Cocoon.process(Cocoon.java, Compiled Code)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java,
Compiled Code)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java,
Compiled Code)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java,
Compiled Code)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java,
Compiled Code)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
DEBUG (2002-08-16) 08:08.57:562 [sitemap.transformer.xslt]
(/cocoon/afringe/wonka.xml) HttpProcessor[8080][4]/TraxTransformer:
Using stylesheet:
'file:/usr/local/jakarta-tomcat-4.0.4/webapps/cocoon/afringe/error2html.xsl'
in org.apache.cocoon.transformation.TraxTransformer@bc22685d, last
modified: 998973544000
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Sending a parameter to Xerces (allow java char encodings)
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Jesse Reynolds [mailto:lizst@va.com.au]
>
> Thanks Vadim
>
> I've changed the code to mention the correct URL, but it is still not
> working. I am confused about why it isn't working. Either:
>
> a) My code is not doing the right thing
> b) Xerces has a bug
> c) I need to make a similar change to another piece of code in cocoon
as well.
>
> Any suggestions?
>
> By the way, when I call a page that has a <map:generate
> type="serverpages" ...> entry in the sitemap, I get the error that I
> posted previously, "unsupported encoding MacRoman" etc. But when I
> call a plain page (no type="serverpages") then I get the following
> screen:
>
> Apache Tomcat/4.0.4 - HTTP Status 404 - Not Found
>
------------------------------------------------------------------------
>
> type: Status report
>
> message: Not Found
>
> description: The requested resource (Not Found) is not available.
Look in the logs, should be some error logged.
Vadim
> If I remove the 'encoding="MacRoman"' from the xml declaration then
> the page works normally.
>
> Thanks
>
> Jesse
>
>
> At 14:52 -0400 11/8/2002, Vadim Gritsenko wrote:
> > > From: Jesse Reynolds [mailto:lizst@va.com.au]
> >>
> >> Hi Vadim et al
> >>
> >> Okay, I've now edited JaxpParser.java, the diff's between the
2.0.2
> >> version (same as the 2.0.3 version) and my modification is below.
> >>
> >> But it doesn't work. What have I missed? Do I need to fix
something
> >> in cocoon.xconf? I've modified it in the 2.0.2 source. ... How can
I
> >> build a test to see if the xml parser is in fact getting the
> >> allow-java-encodings feature turned on? Some XSP perhaps? (I am
> >> really only assuming that Blackdown 1.2.2 JDK does support
MacRoman,
> >> because the Sun JDK 1.2.2 does and we do have a
> >> $JAVA_HOME/jre/lib/i18n.jar file present, but this is an
assumption
> >> that I need to question... but my feeling is that the code i've
> >> written into cocoon is probably just plain wrong...)
> >
> >As google points out, allow-java-encodings should be written as
> >'http://apache.org/xml/features/allow-java-encodings' (96 hits), but
not
> >as 'http://xml.org/sax/features/allow-java-encodings' (3 hits).
> >
> >Seems that there is an error on
> >"http://xml.apache.org/xerces2-j/features.html"
> >page. It has "xml.org" in the example, but if you scroll down, it
talks
> >about "http://apache.org/xml/features/allow-java-encodings".
> >
> >
> >Vadim
> >
> >
> >> Thankyou
> >>
> >> Jesse
> >>
> >> bash-2.04# diff
> >>
./src/java/org/apache/cocoon/components/parser/JaxpParser.java.orig
> >> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java
> >> 138a139,141
> >> > /** do we want to allow all possible text encodings
recognised
> >> >by current JVM? */
> >> > protected boolean allowJavaEncodings;
> >> >
> >> 205a209,214
> >> >
> >> > // Pick up "allow-java-encodings" to allow the use of
> >additional
> >> > // character encodings supported by current JVM (eg
> >"MacRoman")
> >> > // Jesse Reynolds 2002.08.10
> >> > this.allowJavaEncodings =
> >> >params.getParameterAsBoolean("allow-java-encodings", true);
> >> >
> >> 215a225,233
> >> > }
> >> >
> >> > if (this.allowJavaEncodings) {
> >> > try {
> >> >
> >>
>
>>this.reader.setFeature("http://xml.org/sax/features/allow-java-encodin
g
> >s",
> >> >true);
> >> > } catch (SAXException e) {
> >> > getLogger().warn("SAX2 driver does not support
> >> >feature: 'allow-java-encodings' "+
> >> >
> >> >"('http://xml.org/sax/features/allow-java-encodings')");
> >> > }
> >
> >...
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Sending a parameter to Xerces (allow java char encodings)
Posted by Jesse Reynolds <li...@va.com.au>.
Thanks Vadim
I've changed the code to mention the correct URL, but it is still not
working. I am confused about why it isn't working. Either:
a) My code is not doing the right thing
b) Xerces has a bug
c) I need to make a similar change to another piece of code in cocoon as well.
Any suggestions?
By the way, when I call a page that has a <map:generate
type="serverpages" ...> entry in the sitemap, I get the error that I
posted previously, "unsupported encoding MacRoman" etc. But when I
call a plain page (no type="serverpages") then I get the following
screen:
Apache Tomcat/4.0.4 - HTTP Status 404 - Not Found
------------------------------------------------------------------------
type: Status report
message: Not Found
description: The requested resource (Not Found) is not available.
If I remove the 'encoding="MacRoman"' from the xml declaration then
the page works normally.
Thanks
Jesse
At 14:52 -0400 11/8/2002, Vadim Gritsenko wrote:
> > From: Jesse Reynolds [mailto:lizst@va.com.au]
>>
>> Hi Vadim et al
>>
>> Okay, I've now edited JaxpParser.java, the diff's between the 2.0.2
>> version (same as the 2.0.3 version) and my modification is below.
>>
>> But it doesn't work. What have I missed? Do I need to fix something
>> in cocoon.xconf? I've modified it in the 2.0.2 source. ... How can I
>> build a test to see if the xml parser is in fact getting the
>> allow-java-encodings feature turned on? Some XSP perhaps? (I am
>> really only assuming that Blackdown 1.2.2 JDK does support MacRoman,
>> because the Sun JDK 1.2.2 does and we do have a
>> $JAVA_HOME/jre/lib/i18n.jar file present, but this is an assumption
>> that I need to question... but my feeling is that the code i've
>> written into cocoon is probably just plain wrong...)
>
>As google points out, allow-java-encodings should be written as
>'http://apache.org/xml/features/allow-java-encodings' (96 hits), but not
>as 'http://xml.org/sax/features/allow-java-encodings' (3 hits).
>
>Seems that there is an error on
>"http://xml.apache.org/xerces2-j/features.html"
>page. It has "xml.org" in the example, but if you scroll down, it talks
>about "http://apache.org/xml/features/allow-java-encodings".
>
>
>Vadim
>
>
>> Thankyou
>>
>> Jesse
>>
>> bash-2.04# diff
>> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java.orig
>> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java
>> 138a139,141
>> > /** do we want to allow all possible text encodings recognised
>> >by current JVM? */
>> > protected boolean allowJavaEncodings;
>> >
>> 205a209,214
>> >
>> > // Pick up "allow-java-encodings" to allow the use of
>additional
>> > // character encodings supported by current JVM (eg
>"MacRoman")
>> > // Jesse Reynolds 2002.08.10
>> > this.allowJavaEncodings =
>> >params.getParameterAsBoolean("allow-java-encodings", true);
>> >
>> 215a225,233
>> > }
>> >
>> > if (this.allowJavaEncodings) {
>> > try {
>> >
>>
>>this.reader.setFeature("http://xml.org/sax/features/allow-java-encoding
>s",
>> >true);
>> > } catch (SAXException e) {
>> > getLogger().warn("SAX2 driver does not support
>> >feature: 'allow-java-encodings' "+
>> >
>> >"('http://xml.org/sax/features/allow-java-encodings')");
>> > }
>
>...
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
--
Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
Email: jesse (at) va.com.au > Website Development
Phone: +61 (0)8 8223 2288 > Web & Email Hosting
Web: http://jesse.va.com.au > Streaming Media Hosting
> Telehousing / Colocation
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Sending a parameter to Xerces (allow java char encodings)
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Jesse Reynolds [mailto:lizst@va.com.au]
>
> Hi Vadim et al
>
> Okay, I've now edited JaxpParser.java, the diff's between the 2.0.2
> version (same as the 2.0.3 version) and my modification is below.
>
> But it doesn't work. What have I missed? Do I need to fix something
> in cocoon.xconf? I've modified it in the 2.0.2 source. ... How can I
> build a test to see if the xml parser is in fact getting the
> allow-java-encodings feature turned on? Some XSP perhaps? (I am
> really only assuming that Blackdown 1.2.2 JDK does support MacRoman,
> because the Sun JDK 1.2.2 does and we do have a
> $JAVA_HOME/jre/lib/i18n.jar file present, but this is an assumption
> that I need to question... but my feeling is that the code i've
> written into cocoon is probably just plain wrong...)
As google points out, allow-java-encodings should be written as
'http://apache.org/xml/features/allow-java-encodings' (96 hits), but not
as 'http://xml.org/sax/features/allow-java-encodings' (3 hits).
Seems that there is an error on
"http://xml.apache.org/xerces2-j/features.html"
page. It has "xml.org" in the example, but if you scroll down, it talks
about "http://apache.org/xml/features/allow-java-encodings".
Vadim
> Thankyou
>
> Jesse
>
> bash-2.04# diff
> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java.orig
> ./src/java/org/apache/cocoon/components/parser/JaxpParser.java
> 138a139,141
> > /** do we want to allow all possible text encodings recognised
> >by current JVM? */
> > protected boolean allowJavaEncodings;
> >
> 205a209,214
> >
> > // Pick up "allow-java-encodings" to allow the use of
additional
> > // character encodings supported by current JVM (eg
"MacRoman")
> > // Jesse Reynolds 2002.08.10
> > this.allowJavaEncodings =
> >params.getParameterAsBoolean("allow-java-encodings", true);
> >
> 215a225,233
> > }
> >
> > if (this.allowJavaEncodings) {
> > try {
> >
>
>this.reader.setFeature("http://xml.org/sax/features/allow-java-encoding
s",
> >true);
> > } catch (SAXException e) {
> > getLogger().warn("SAX2 driver does not support
> >feature: 'allow-java-encodings' "+
> >
> >"('http://xml.org/sax/features/allow-java-encodings')");
> > }
...
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>