Author: dkulp
Date: Mon Mar 25 17:56:30 2013
New Revision: 1460789
URL: http://svn.apache.org/r1460789
Log:
Merged revisions 1460772 via git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1460772 | dkulp | 2013-03-25 13:34:28 -0400 (Mon, 25 Mar 2013) | 2 lines
If cannot create a parser factory at startup, allow trying at runtime.
........
Modified:
cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Modified:
cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1460789&r1=1460788&r2=1460789&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
(original)
+++
cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Mon Mar 25 17:56:30 2013
@@ -163,14 +163,19 @@ public final class StaxUtils {
allowInsecureParser = "1".equals(s) || Boolean.parseBoolean(s);
}
- XMLInputFactory xif = createXMLInputFactory(true);
- String xifClassName = xif.getClass().getName();
- if (xifClassName.contains("ctc.wstx") ||
xifClassName.contains("xml.xlxp")
- || xifClassName.contains("xml.xlxp2") ||
xifClassName.contains("bea.core")) {
- SAFE_INPUT_FACTORY = xif;
- } else {
- SAFE_INPUT_FACTORY = null;
+ XMLInputFactory xif = null;
+ try {
+ xif = createXMLInputFactory(true);
+ String xifClassName = xif.getClass().getName();
+ if (!xifClassName.contains("ctc.wstx") &&
!xifClassName.contains("xml.xlxp")
+ && !xifClassName.contains("xml.xlxp2") &&
!xifClassName.contains("bea.core")) {
+ xif = null;
+ }
+ } catch (Throwable t) {
+ //ignore, can always drop down to the pooled factories
+ xif = null;
}
+ SAFE_INPUT_FACTORY = xif;
XMLOutputFactory xof = XMLOutputFactory.newInstance();
String xofClassName = xof.getClass().getName();