Author: julien_viet
Date: 2010-10-19 05:45:31 -0400 (Tue, 19 Oct 2010)
New Revision: 4721
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java
Log:
GTNPORTAL-1569 : use com.sun.xml.internal.stream.XMLOutputFactoryImpl constructor via
reflection instead of XMLOutputFactory.newFactory() as this was added only since revision
18 of Java 6
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java
===================================================================
---
portal/trunk/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java 2010-10-18
23:35:13 UTC (rev 4720)
+++
portal/trunk/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java 2010-10-19
09:45:31 UTC (rev 4721)
@@ -61,12 +61,13 @@
XMLOutputFactory tmp;
try
{
- tmp = XMLOutputFactory.newFactory(DEFAULT_XML_OUTPUT_FACTORY,
Thread.currentThread().getContextClassLoader());
+ Class<XMLOutputFactory> cl =
(Class<XMLOutputFactory>)Thread.currentThread().getContextClassLoader().loadClass(DEFAULT_XML_OUTPUT_FACTORY);
+ tmp = cl.newInstance();
}
- catch (FactoryConfigurationError error)
+ catch (Exception e)
{
- tmp = XMLOutputFactory.newFactory();
- log.warn("Could not use " + DEFAULT_XML_OUTPUT_FACTORY + " will
use default provided by runtime instead " +
+ tmp = XMLOutputFactory.newInstance();
+ log.warn("Could not instantiate " + DEFAULT_XML_OUTPUT_FACTORY +
" will use default provided by runtime instead " +
tmp.getClass().getName());
}