Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDK 1.6 and Xerces?

Tags:

java

xml

legacy

In my current project, we target a JDK 1.6 Runtime environment. For legacy rasons, Xerces JAR files are bundled in the application.

These are no longer needed right? The JDK has (for a while) had XML parsing libraries bundled in the JDK?

like image 925
Glenn Bech Avatar asked Oct 17 '11 13:10

Glenn Bech


1 Answers

The parser in the JDK was a fork of Xerces, but it is very buggy. I would recommend production applications always to use the Apache version of the parser in preference. The bugs are rare, but they are unpredictable, and they don't only affect corner cases that aren't seen in real life; I've seen many cases where quite boring XML documents are being parsed, and corrupt data is passed to the application for attribute values. Sun/Oracle have shown no interest in fixing the problem. Use Apache Xerces every time.

UPDATE (2018)

The problems with the JDK version of Xerces seem to have been resolved in Java 8, as far as I can see, so this advice is out of date.

like image 94
Michael Kay Avatar answered Sep 27 '22 23:09

Michael Kay