bpurcell.org - Changing XML Parsers in JRun or ColdFusionMX
Calendar
SunMonTueWedThuFriSat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Subject Archives
Amazon EC2 (15)
ColdFusionMX (155)
Corvette (3)
Flash Lite (4)
Flash Media Server (5)
Flash Player (3)
Flex (39)
General Web Dev (14)
HDTV (3)
Jboss (1)
Jquery (2)
JRun (59)
Max 2003 (3)
Other (33)
PC Hardware (16)
Software (17)
SpatialKey (7)
Wireless (8)
Working Out (1)

RSS Feed
Feed Listing

Site Contents
Home
My Blog
ColdFusion
JRun
Flex
Wireless & Networking
Hardware & Gadgets
HDTV
Software Picks
Pictures
Contact Me
Search


My Articles & Papers
Flex Performance
Server/Client
mm.com Under the Hood
Multiple Instances of CFMX
Multiple Instance Config
NLB with ColdFusion
Clustering CFMX for J2EE
Multi-Tier Hardware LB w CFMX
Cisco CSS & Coldfusion MX
JRun 4 Jini based Clustering
WiFi Growth

2ID Tacweb

Other Hobbys
Body-For-Life Challenge

Personal Projects
Family Pool
Deck Gate

username:
password:
 

 
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):

  1. Get the Xerces kit at http://xml.apache.org/dist/xerces-j/Xerces-J-bin.1.4.4.zip
  2. extract xerces.jar and place it in the classpath ahead of jrun.jar (for example, in runtime/servers/lib)
  3. 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
  4. 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?


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


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.


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.


I was informed by Macromedia staff that using any parser besides Crimson is NOT supported.


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


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.


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


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


Thanks ever so much. Apologies for the delay in thanking you, but I kind of got snowed under with things before Christmas.


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?


 
Page Render Time:0