Save to overwrite Java system properties?

6
Is it safe to overwrite Java system properties like javax.xml.transform.TransformerFactory in Mendix Java actions, or can/will this cause problems with some Mendix code? The background info for this particular question is as follows: my project uses some Java code that requires an XSLT 2.0 processor. Since the Java default libraries only support version 1.0 I added the latest version of the Saxon library to the classpath. This "automatically" causes any TransformerFactory to use this library, because the .jar contains the META-INF/services/javax.xml.transform.TransformerFactory file according to the services API which is used in the lookup procedure (see here). The above worked fine in Mendix 2.4, but when upgrading to 2.5 my code didn't work properly and I noticed the Xalan XSLT processor was now being used. Apperently in 2.5 this library was added to the Mendix classpath and it also contains a META-INF/services/javax.xml.transform.TransformerFactory file. As I really needed the Saxon processor (Xalan doesn't support XSLT 2.0 and contains bugs that keep my code from working) I've overwritten the javax.xml.transform.TransformerFactory system property. Since this change effectively disables the use of the Xalan library (when using the default TransformerFactory lookup procedure), I'm wondering what impact this might have on the Mendix code. This question also applies for a lot of other system properties that are used by similar constructions in Java (javax.xml.xpath.XPathFactory, user.dir, javax.xml.validation.SchemaFactory, etc).
asked
0 answers