Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.4.3, 2.0.0-M2
-
Fix Version/s: 1.4.4
-
Labels:
-
User impact:Medium
-
Similar Issues:None
Description
Since the m1->m2 migration and the cleanups of the XML dependencies both mule-core and module-xml reference xml-apis and xercesImpl, to provide working SAX/DOM capabilities when running on JDK 1.4. Since the PSR work and also future modules (CXF?) will require JDK 1.5/1.6 at both compile and run-time, these dependencies must be removed even though they seem to work correctly at the moment.
Handling the parser problem for JDK 1.4 through the "endorsed" mechanism is the only correct way, as the following two notes explain:
http://xerces.apache.org/xerces2-j/faq-general.html#faq-4
http://xml.apache.org/xalan-j/faq.html#faq-N100D6
The only correct scenarios are:
- JDK 1.4: adding an XML implementation (xml-apis + xercesImpl or Sun's JAXP) to an endorsed directory, manually in <jre>/lib/endorsed and by adding a new directory for the service wrapper when starting Mule as server
- JDK 1.5: by default no action necessary, though users MAY install an updated JAXP (see http://jaxp.dev.java.net/) in <jre>/lib/endorsed to update SAX/DOM or gain the new StAX capabilities introduced in JAXP 1.4 and shipping with JDK 1.6
- JDK 1.6: no action necessary, and even though users MAY install an updated JAXP (see above) it is most likely not necessary as JAXP 1.4 revisions usually trail JDK 1.6 releases.
An interesting corner case is our dependency on woodstox, which is not necessary when running on JDK 1.6 (as StAX is built in there); the good news is that there are no conflicts since the package names are completely different and therefore the discovery process does not get confused as with SAX/DOM. So woodstox can remain on the classpath for all JDKs, both when necessary (JDK 1.4/1.5 without endorsed JAXP 1.4) and redundant but harmless (JDK 1.6).
In any case, the bottom line is that regardless of JDK used for building or deploying, there must not be any xml-apis or xerces on the classpath, no matter what version. This makes checking for classpath violations very easy.
A natural place for this validation could be the Mule's bootstrap process. However there are 2 concerns:
E.g. if a well-known jar name pattern is found, Mule can fail early with suggestions on how to do the XML libs endorsement properly.
- It'll cover only standalone mode naturally
- There are some pending merges for this module, extra modifications will add more work later (though it doesn't mean we shouldn't do it).
E.g. if a well-known jar name pattern is found, Mule can fail early with suggestions on how to do the XML libs endorsement properly.