Viewing Individual Entry / Main
September 3, 2003
If you want to switch the XML parser that JRun or CFMX uses it is pretty simple. Crimson is the default parser that is used and it is packaged with JRun. To use the Xerces parser rather than the Crimson parser follow the following procedure (thanks to Tom Donovan):
- Get the Xerces kit at http://xml.apache.org/dist/xerces-j/Xerces-J-bin.1.4.4.zip
- extract xerces.jar and place it in the classpath ahead of jrun.jar (for example, in runtime/servers/lib)
- add these switches to the JVM arguments in CF Administrator (or in jvm.config for JRun). Note that this is one long line, not three lines -
Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
- restart CFMX ( JRun)
Comments
I also need ToString patch for a hosted server with sandbox security.
I do not think so but when I update my parser, are there any change for this status?
Posted by Tarantor at
Sorry brandon, I don't have it, Just got it from a few references via google when I aquired the problem.
From what I've gathered, when your in a sandbox (situation is on a shared server). When you put the xml into the DOM via xmlparse(),manipulate it and try putting it back to a string via tostring() it doesn't return the string, matter infact, it doesn't return anything, just the literal null. (writeoutput(xmlobj) = [null]). I'll look further to see if I can find a definitive reference @ MM's site for an error. Just thought it would seem common since shared hosting is primarily sandboxed.
Cheers
Posted by Robby at
I would have to know the bug# for the issue you are refering to. I could not find this issue in our bugtracker when I searched.
Posted by Brandon at
We can support the use of alternative parsers up to the point where a defect can be isolated to that parser and where the defect is not reproducible if using the default parser. If a defect is isolated to the alternative parser, then the vendor of that parser is responsible for the fix, and where possible, we can help develop a test case that demonstrates such defect so that it may be submitted for a bug report to that vendor.
Posted by Steven Erat at
I was informed by Macromedia staff that using any parser besides Crimson is NOT supported.
Posted by Matt Liotta at
Just out of curiosity, was the tostring() on an xml object (when in a sandbox)fixed in 6.1? If not would switching to X. help in that regard or it is a DOM to String conversion problem. Cheers, Robby
Posted by robby at
Could you send me a reproducible case for this ToString issue I could not find in our bugtracker. My email is bpurcell at macromedia.com.
Posted by Brandon Purcell at 9/30/03 9:36 PM
Hi, I have been looking into a way to use a different XML parser with ColdFusion when I stumbled across your blog entry on using Xerces with CFMX and this is exactly what I am after. However I am unsure as to how best apply the information you have put up. I downloaded the Xerces Kit and extracted the exerces.jar file and placed it in c:\jrun\lib\ then I edited the jvm.config file to point to that file, like such:
# JVM classpath java.class.path={application.home}/servers/lib,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion.jar,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib,{application.home}/lib/xerces.jar,{application.home}/lib/jrun.jar,{application.home}/lib
So far so good, however here is my question where exactly do i put the follwoing line?
Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
Would it go under?
# Arguments to VM java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -Xbootclasspath/a:"{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/webchartsJava2D.jar" -XX:MaxPermSize=128m -XX:+UseParallelGC -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS
If so how do I append it to that line? As is with a space? Or with a dash?
Thanks in advance for any help you may be able to provide.
Cheer Greg
Posted by Greg at 12/5/03 7:01 AM
You should just add the lines into the java.args and you do need the - in front. It should something like the following:
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -Xbootclasspath/a:"{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/webchartsJava2D.jar" -XX:MaxPermSize=128m -XX:+UseParallelGC -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
Posted by Brandon at 12/7/03 9:22 AM
Thanks ever so much. Apologies for the delay in thanking you, but I kind of got snowed under with things before Christmas.
Posted by Greg at 1/5/04 8:04 AM
Here is an interesting question - i'm trying to use a web service from a BlueDragon CFMX Server to hit a regular CFMX Server, however, even with XMLFormat i'm getting an illegal character error, "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x19) was found in the element content of the document." I imagine I need to get BlueDragon to use the same parser as CFMX?
Posted by Paul at 11/23/04 7:51 AM
|