[Java] JAXP Parser Implementations
recently i had problems processing large xml files. jdk 1.4.2 is in use on all platforms. our customer uses a sun fire solaris system, development takes place on a w2000 eclipse 3.2. errormessage goes like this:
org.xml.sax.SAXParseException: Parser has reached the entity expansion limit "64,000"
i read some documentation and soon discovered the system property "entityExpansionLimit". with this its possible to set the limit on a large value; the default is 64K. but to my surprise it worked on windows2000 but not on the customers solaris system. i read about that jdk 1.4.2 is shipped with xerces instead of the crimson as parser, and for xerces the above system property is defined to work. i checked the endorsed directory and verified the nonexistance of a jaxp.properties. so in both environments the saxparserfactory returns the default implementation. on w2000 this is an org.apache.xerces.jaxp.SAXParserImpl, and on solaris, a crimson () is in use. as a solution, i provided a xerces.jar on the classpath and forced its usage with the help of the systemproperty javax.xml.parsers.SAXParserFactory. for xerces and crimson its possible to provide the value org.apache.xerces.jaxp.SAXParserFactoryImpl or org.apache.crimson.jaxp.
SAXParserFactoryImpl. for DOM and XSLT the properties javax.xml.parsers.DocumentBuilderFactory or javax.xml.transformer.TransformerFactory
org.xml.sax.SAXParseException: Parser has reached the entity expansion limit "64,000"
i read some documentation and soon discovered the system property "entityExpansionLimit". with this its possible to set the limit on a large value; the default is 64K. but to my surprise it worked on windows2000 but not on the customers solaris system. i read about that jdk 1.4.2 is shipped with xerces instead of the crimson as parser, and for xerces the above system property is defined to work. i checked the endorsed directory and verified the nonexistance of a jaxp.properties. so in both environments the saxparserfactory returns the default implementation. on w2000 this is an org.apache.xerces.jaxp.SAXParserImpl, and on solaris, a crimson () is in use. as a solution, i provided a xerces.jar on the classpath and forced its usage with the help of the systemproperty javax.xml.parsers.SAXParserFactory. for xerces and crimson its possible to provide the value org.apache.xerces.jaxp.SAXParserFactoryImpl or org.apache.crimson.jaxp.
SAXParserFactoryImpl. for DOM and XSLT the properties javax.xml.parsers.DocumentBuilderFactory or javax.xml.transformer.TransformerFactory

0 Comments:
Kommentar veröffentlichen
<< Home