Author: alessio.soldano(a)jboss.com
Date: 2013-04-04 12:13:36 -0400 (Thu, 04 Apr 2013)
New Revision: 17444
Modified:
thirdparty/cxf/branches/cxf-2.6.6/api/pom.xml
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/DepthRestrictingStreamReader.java
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
thirdparty/cxf/branches/cxf-2.6.6/parent/pom.xml
thirdparty/cxf/branches/cxf-2.6.6/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/jaxb/pom.xml
thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/sdo/pom.xml
thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/xmlbeans/pom.xml
thirdparty/cxf/branches/cxf-2.6.6/tools/corba/pom.xml
Log:
Upgrade to woodstox 4.2.0
Modified: thirdparty/cxf/branches/cxf-2.6.6/api/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.6.6/api/pom.xml 2013-04-04 15:01:17 UTC (rev 17443)
+++ thirdparty/cxf/branches/cxf-2.6.6/api/pom.xml 2013-04-04 16:13:36 UTC (rev 17444)
@@ -102,9 +102,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>${cxf.stax.impl.groupId}</groupId>
- <artifactId>${cxf.stax.impl.artifactId}</artifactId>
- <scope>runtime</scope>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
</dependency>
<dependency>
Modified:
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java 2013-04-04
15:01:17 UTC (rev 17443)
+++
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java 2013-04-04
16:13:36 UTC (rev 17444)
@@ -120,16 +120,50 @@
}
}
}
+ xreader = configureRestrictions(xreader, message);
} catch (XMLStreamException e) {
throw new Fault(new
org.apache.cxf.common.i18n.Message("STREAM_CREATE_EXC",
LOG,
encoding), e);
}
-
message.setContent(XMLStreamReader.class, xreader);
message.getInterceptorChain().add(StaxInEndingInterceptor.INSTANCE);
}
+ private XMLStreamReader configureRestrictions(XMLStreamReader xreader, Message
message) throws XMLStreamException {
+ Integer maxChildElements = getInteger(message, StaxUtils.MAX_CHILD_ELEMENTS);
+ Integer maxElementDepth = getInteger(message, StaxUtils.MAX_ELEMENT_DEPTH);
+ Integer maxAttributeCount = getInteger(message, StaxUtils.MAX_ATTRIBUTE_COUNT);
+ Integer maxAttributeSize = getInteger(message, StaxUtils.MAX_ATTRIBUTE_SIZE);
+ Integer maxTextLength = getInteger(message, StaxUtils.MAX_TEXT_LENGTH);
+ Long maxElementCount = getLong(message, StaxUtils.MAX_ELEMENT_COUNT);
+ Long maxXMLCharacters = getLong(message, StaxUtils.MAX_XML_CHARACTERS);
+ return StaxUtils.configureReader(xreader, maxChildElements, maxElementDepth,
+ maxAttributeCount, maxAttributeSize,
maxTextLength,
+ maxElementCount, maxXMLCharacters);
+ }
+ private Long getLong(Message message, String key) {
+ Object o = message.getContextualProperty(key);
+ if (o instanceof Long) {
+ return (Long)o;
+ } else if (o instanceof Number) {
+ return ((Number)o).longValue();
+ } else if (o instanceof String) {
+ return Long.valueOf(o.toString());
+ }
+ return null;
+ }
+ private Integer getInteger(Message message, String key) {
+ Object o = message.getContextualProperty(key);
+ if (o instanceof Integer) {
+ return (Integer)o;
+ } else if (o instanceof Number) {
+ return ((Number)o).intValue();
+ } else if (o instanceof String) {
+ return Integer.valueOf((String)o);
+ }
+ return null;
+ }
public static XMLInputFactory getXMLInputFactory(Message m) throws Fault {
Object o = m.getContextualProperty(XMLInputFactory.class.getName());
if (o instanceof XMLInputFactory) {
Modified:
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/DepthRestrictingStreamReader.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/DepthRestrictingStreamReader.java 2013-04-04
15:01:17 UTC (rev 17443)
+++
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/DepthRestrictingStreamReader.java 2013-04-04
16:13:36 UTC (rev 17444)
@@ -42,10 +42,9 @@
int elementCountThreshold,
int innerElementLevelThreshold,
int innerElementCountThreshold) {
- super(reader);
- this.props = new DocumentDepthProperties(elementCountThreshold,
- innerElementLevelThreshold,
- innerElementCountThreshold);
+ this(reader, new DocumentDepthProperties(elementCountThreshold,
+ innerElementLevelThreshold,
+ innerElementCountThreshold));
}
public DepthRestrictingStreamReader(XMLStreamReader reader,
Modified:
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java 2013-04-04
15:01:17 UTC (rev 17443)
+++
thirdparty/cxf/branches/cxf-2.6.6/api/src/main/java/org/apache/cxf/staxutils/StaxUtils.java 2013-04-04
16:13:36 UTC (rev 17444)
@@ -32,6 +32,7 @@
import java.util.Stack;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.namespace.NamespaceContext;
@@ -76,6 +77,8 @@
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
+import com.ctc.wstx.stax.WstxInputFactory;
+
import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
@@ -83,8 +86,29 @@
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.helpers.XMLUtils;
+import org.codehaus.stax2.XMLStreamReader2;
public final class StaxUtils {
+ // System properies for defaults, but also contextual properties usable
+ // for StaxInInterceptor
+ public static final String MAX_CHILD_ELEMENTS =
+ "org.apache.cxf.stax.maxChildElements";
+ public static final String MAX_ELEMENT_DEPTH =
+ "org.apache.cxf.stax.maxElementDepth";
+ public static final String MAX_ATTRIBUTE_COUNT =
+ "org.apache.cxf.stax.maxAttributeCount";
+ public static final String MAX_ATTRIBUTE_SIZE =
+ "org.apache.cxf.stax.maxAttributeSize";
+ public static final String MAX_TEXT_LENGTH =
+ "org.apache.cxf.stax.maxTextLength";
+ public static final String MAX_ELEMENT_COUNT =
+ "org.apache.cxf.stax.maxElementCount";
+ public static final String MAX_XML_CHARACTERS =
+ "org.apache.cxf.stax.maxXMLCharacters";
+
+ public static final String ALLOW_INSECURE_PARSER =
+ "org.apache.cxf.stax.allowInsecureParser";
+
private static final String INNER_ELEMENT_COUNT_SYSTEM_PROP =
"org.apache.cxf.staxutils.innerElementCountThreshold";
private static final String INNER_ELEMENT_LEVEL_SYSTEM_PROP =
@@ -104,51 +128,53 @@
"ns7".intern(), "ns8".intern(), "ns9".intern()
};
- private static int innerElementLevelThreshold = -1;
- private static int innerElementCountThreshold = -1;
+ private static int innerElementLevelThreshold = 100;
+ private static int innerElementCountThreshold = 50000;
+ private static int maxAttributeCount = 500;
+ private static int maxAttributeSize = 64 * 1024; //64K per attribute, likely just
"list" will hit
+ private static int maxTextLength = 128 * 1024 * 1024; //128M - more than this should
DEFINITLEY use MTOM
+ private static long maxElementCount = Long.MAX_VALUE;
+ private static long maxXMLCharacters = Long.MAX_VALUE;
+ //will change to false in the near future
+ private static boolean allowInsecureParser = true;
+
static {
- int i = 20;
+ int i = getInteger("org.apache.cxf.staxutils.pool-size", 20);
- try {
- String s =
SystemPropertyAction.getProperty("org.apache.cxf.staxutils.pool-size",
- "-1");
- i = Integer.parseInt(s);
- } catch (Throwable t) {
- //ignore
- i = 20;
- }
- if (i <= 0) {
- i = 20;
- }
NS_AWARE_INPUT_FACTORY_POOL = new ArrayBlockingQueue<XMLInputFactory>(i);
OUTPUT_FACTORY_POOL = new ArrayBlockingQueue<XMLOutputFactory>(i);
- try {
- String s = SystemPropertyAction.getProperty(INNER_ELEMENT_LEVEL_SYSTEM_PROP,
"-1");
- innerElementLevelThreshold = Integer.parseInt(s);
- } catch (Throwable t) {
- innerElementLevelThreshold = -1;
+
+ //old names
+ innerElementCountThreshold = getInteger(INNER_ELEMENT_LEVEL_SYSTEM_PROP,
innerElementCountThreshold);
+ innerElementLevelThreshold = getInteger(INNER_ELEMENT_COUNT_SYSTEM_PROP,
innerElementLevelThreshold);
+ //new names
+ innerElementCountThreshold = getInteger(MAX_CHILD_ELEMENTS,
innerElementCountThreshold);
+ innerElementLevelThreshold = getInteger(MAX_ELEMENT_DEPTH,
innerElementLevelThreshold);
+ maxAttributeCount = getInteger(MAX_ATTRIBUTE_COUNT, maxAttributeCount);
+ maxAttributeSize = getInteger(MAX_ATTRIBUTE_SIZE, maxAttributeSize);
+ maxTextLength = getInteger(MAX_TEXT_LENGTH, maxTextLength);
+ maxElementCount = getLong(MAX_ELEMENT_COUNT, maxElementCount);
+ maxXMLCharacters = getLong(MAX_XML_CHARACTERS, maxXMLCharacters);
+
+ String s = SystemPropertyAction.getPropertyOrNull(ALLOW_INSECURE_PARSER);
+ if (!StringUtils.isEmpty(s)) {
+ allowInsecureParser = "1".equals(s) || Boolean.parseBoolean(s);
}
- if (innerElementLevelThreshold <= 0) {
- innerElementLevelThreshold = -1;
- }
+
+ XMLInputFactory xif = null;
try {
- String s = SystemPropertyAction.getProperty(INNER_ELEMENT_COUNT_SYSTEM_PROP,
"-1");
- innerElementCountThreshold = Integer.parseInt(s);
+ 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) {
- innerElementCountThreshold = -1;
+ //ignore, can always drop down to the pooled factories
+ xif = null;
}
- if (innerElementCountThreshold <= 0) {
- innerElementCountThreshold = -1;
- }
- 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;
- }
+ SAFE_INPUT_FACTORY = xif;
XMLOutputFactory xof = XMLOutputFactory.newInstance();
String xofClassName = xof.getClass().getName();
@@ -163,6 +189,38 @@
private StaxUtils() {
}
+ private static int getInteger(String prop, int def) {
+ try {
+ String s = SystemPropertyAction.getPropertyOrNull(prop);
+ if (StringUtils.isEmpty(s)) {
+ return def;
+ }
+ int i = Integer.parseInt(s);
+ if (i < 0) {
+ i = def;
+ }
+ return i;
+ } catch (Throwable t) {
+ //ignore
+ }
+ return def;
+ }
+ private static long getLong(String prop, long def) {
+ try {
+ String s = SystemPropertyAction.getPropertyOrNull(prop);
+ if (StringUtils.isEmpty(s)) {
+ return def;
+ }
+ long i = Long.parseLong(s);
+ if (i < 0) {
+ i = def;
+ }
+ return i;
+ } catch (Throwable t) {
+ //ignore
+ }
+ return def;
+ }
public static void setInnerElementLevelThreshold(int i) {
innerElementLevelThreshold = i;
@@ -228,10 +286,24 @@
/**
* Return a new factory so that the caller can set sticky parameters.
* @param nsAware
- * @return
+ * @throws XMLStreamException
*/
public static XMLInputFactory createXMLInputFactory(boolean nsAware) {
XMLInputFactory factory = XMLInputFactory.newInstance();
+ if (!setRestrictionProperties(factory)) {
+ try {
+ factory = createWoodstoxFactory();
+ } catch (Throwable t) {
+ //ignore for now
+ }
+ if (!setRestrictionProperties(factory)) {
+ if (allowInsecureParser) {
+ LOG.log(Level.WARNING, "INSECURE_PARSER_DETECTED",
factory.getClass().getName());
+ } else {
+ throw new RuntimeException("Cannot create a secure
XMLInputFactory");
+ }
+ }
+ }
setProperty(factory, XMLInputFactory.IS_NAMESPACE_AWARE, nsAware);
setProperty(factory, XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
setProperty(factory, XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,
Boolean.FALSE);
@@ -243,15 +315,36 @@
throw new XMLStreamException("Reading external entities is
disabled");
}
});
+
return factory;
}
- private static void setProperty(XMLInputFactory f, String p, Object o) {
+ private static XMLInputFactory createWoodstoxFactory() {
+ return new WstxInputFactory();
+ }
+ private static boolean setRestrictionProperties(XMLInputFactory factory) {
+ //For now, we can only support Woodstox 4.2.x and newer as none of the other
+ //stax parsers support these settings
+ if (setProperty(factory, "com.ctc.wstx.maxAttributesPerElement",
maxAttributeCount)
+ && setProperty(factory, "com.ctc.wstx.maxAttributeSize",
maxAttributeSize)
+ && setProperty(factory,
"com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold)
+ && setProperty(factory, "com.ctc.wstx.maxElementCount",
maxElementCount)
+ && setProperty(factory, "com.ctc.wstx.maxElementDepth",
innerElementLevelThreshold)
+ && setProperty(factory, "com.ctc.wstx.maxCharacters",
maxXMLCharacters)
+ && setProperty(factory, "com.ctc.wstx.maxTextLength",
maxTextLength)) {
+ return true;
+ }
+ return false;
+ }
+
+ private static boolean setProperty(XMLInputFactory f, String p, Object o) {
try {
f.setProperty(p, o);
+ return true;
} catch (Throwable t) {
//ignore
}
+ return false;
}
@@ -1619,5 +1712,84 @@
}
}
}
+
+ //CHECKSTYLE:OFF - lots of params to configure
+ public static XMLStreamReader configureReader(XMLStreamReader reader, Integer
maxChildElements,
+ Integer maxElementDepth, Integer
maxAttributeCount,
+ Integer maxAttributeSize, Integer maxTextLength,
+ Long maxElementCount, Long maxXMLCharacters)
+ throws XMLStreamException {
+ //CHECKSTYLE:ON
+
+ // We currently ONLY support Woodstox 4.2.x for most of this other than a few
things
+ // that we can handle via a wrapper.
+ try {
+ DocumentDepthProperties p = null;
+ if (maxChildElements != null) {
+ try {
+ setProperty(reader, "com.ctc.wstx.maxChildrenPerElement",
maxChildElements);
+ } catch (Throwable t) {
+ //we can handle this via a wrapper
+ p = new DocumentDepthProperties();
+ p.setInnerElementCountThreshold(maxChildElements);
+ }
+ }
+ if (maxElementDepth != null) {
+ try {
+ setProperty(reader, "com.ctc.wstx.maxElementDepth",
maxElementDepth);
+ } catch (Throwable t) {
+ //we can handle this via a wrapper
+ if (p == null) {
+ p = new DocumentDepthProperties();
+ }
+ p.setInnerElementLevelThreshold(maxElementDepth);
+ }
+ }
+ if (maxAttributeCount != null) {
+ setProperty(reader, "com.ctc.wstx.maxAttributeCount",
maxAttributeCount);
+ }
+ if (maxAttributeSize != null) {
+ setProperty(reader, "com.ctc.wstx.maxAttributeSize",
maxAttributeSize);
+ }
+ if (maxTextLength != null) {
+ setProperty(reader, "com.ctc.wstx.maxTextLength",
maxTextLength);
+ }
+ if (maxElementCount != null) {
+ try {
+ setProperty(reader, "com.ctc.wstx.maxElementCount",
maxElementCount);
+ } catch (Throwable t) {
+ //we can handle this via a wrapper
+ if (p == null) {
+ p = new DocumentDepthProperties();
+ }
+ p.setElementCountThreshold(maxElementCount.intValue());
+ }
+ }
+ if (maxXMLCharacters != null) {
+ setProperty(reader, "com.ctc.wstx.maxCharacters",
maxXMLCharacters);
+ }
+ if (p != null) {
+ reader = new DepthRestrictingStreamReader(reader, p);
+ }
+ } catch (ClassCastException cce) {
+ //not an XMLStreamReader2
+ if (allowInsecureParser) {
+ LOG.warning("INSTANCE_NOT_XMLSTREAMREADER2");
+ } else {
+ throw new XMLStreamException(cce);
+ }
+ } catch (IllegalArgumentException cce) {
+ //not a property supported by this version of woodstox
+ if (allowInsecureParser) {
+ LOG.log(Level.WARNING, "SECURE_PROPERTY_NOT_SUPPORTED",
cce.getMessage());
+ } else {
+ throw new XMLStreamException(cce);
+ }
+ }
+ return reader;
+ }
+ private static void setProperty(XMLStreamReader reader, String p, Object v) {
+ ((XMLStreamReader2)reader).setProperty(p, v);
+ }
}
Modified: thirdparty/cxf/branches/cxf-2.6.6/parent/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.6.6/parent/pom.xml 2013-04-04 15:01:17 UTC (rev 17443)
+++ thirdparty/cxf/branches/cxf-2.6.6/parent/pom.xml 2013-04-04 16:13:36 UTC (rev 17444)
@@ -145,11 +145,8 @@
<cxf.spring.osgi.version>1.2.1</cxf.spring.osgi.version>
<cxf.spring.ldap.version>1.3.1.RELEASE</cxf.spring.ldap.version>
<cxf.spring.mock>spring-test</cxf.spring.mock>
- <cxf.stax.impl.groupId>org.codehaus.woodstox</cxf.stax.impl.groupId>
-
<cxf.stax.impl.artifactId>woodstox-core-asl</cxf.stax.impl.artifactId>
-
<cxf.stax.impl.version>${cxf.woodstox.core.version}</cxf.stax.impl.version>
<cxf.velocity.version>1.7</cxf.velocity.version>
- <cxf.woodstox.core.version>4.1.4</cxf.woodstox.core.version>
+ <cxf.woodstox.core.version>4.2.0</cxf.woodstox.core.version>
<cxf.woodstox.stax2-api.version>3.1.1</cxf.woodstox.stax2-api.version>
<cxf.wsdl4j.version>1.6.2</cxf.wsdl4j.version>
<cxf.wss4j.version>1.6.9</cxf.wss4j.version>
@@ -718,23 +715,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>${cxf.stax.impl.groupId}</groupId>
- <artifactId>${cxf.stax.impl.artifactId}</artifactId>
- <version>${cxf.stax.impl.version}</version>
- <!-- these are motivated by Woodstox, but they can't hurt with
others. -->
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- <!-- this one comes from sjsxp -->
- <exclusion>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -1511,6 +1491,17 @@
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>${cxf.woodstox.core.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ <!-- this one comes from sjsxp -->
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>net.java.dev.msv</groupId>
@@ -1572,27 +1563,6 @@
</properties>
</profile>
<profile>
- <!-- sjsxp is really the precursor to the jaxp-ri jars. However, getting
the jaxp-ri jar to work on
- Java 5 requires endorsing it which is non-trivial in maven :-(.
- -->
- <id>sjsxp</id>
- <properties>
-
<cxf.stax.impl.groupId>com.sun.xml.stream</cxf.stax.impl.groupId>
- <cxf.stax.impl.artifactId>sjsxp</cxf.stax.impl.artifactId>
- <cxf.stax.impl.version>1.0.1</cxf.stax.impl.version>
- </properties>
- </profile>
- <profile>
- <!-- This really only works with Java 6 as the classes are identically
named with the same classes in the Java 5 JDK
- and the Java 5 versions get picked up instead -->
- <id>jaxpri</id>
- <properties>
-
<cxf.stax.impl.groupId>com.sun.xml.parsers</cxf.stax.impl.groupId>
- <cxf.stax.impl.artifactId>jaxp-ri</cxf.stax.impl.artifactId>
- <cxf.stax.impl.version>1.4.2</cxf.stax.impl.version>
- </properties>
- </profile>
- <profile>
<id>axis2-saaj</id>
<properties>
<cxf.saaj.impl.groupId>org.apache.axis2</cxf.saaj.impl.groupId>
Modified:
thirdparty/cxf/branches/cxf-2.6.6/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.6.6/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java 2013-04-04
15:01:17 UTC (rev 17443)
+++
thirdparty/cxf/branches/cxf-2.6.6/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java 2013-04-04
16:13:36 UTC (rev 17444)
@@ -25,6 +25,7 @@
import javax.xml.stream.XMLStreamReader;
+import org.apache.cxf.interceptor.StaxInInterceptor;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
@@ -43,6 +44,7 @@
public DepthRestrictingStreamInterceptor() {
this(Phase.POST_STREAM);
+ addAfter(StaxInInterceptor.class.getName());
}
public DepthRestrictingStreamInterceptor(String phase) {
@@ -69,16 +71,16 @@
return;
}
- XMLStreamReader reader = null;
- InputStream is = message.getContent(InputStream.class);
- if (is != null) {
- reader = StaxUtils.createXMLStreamReader(is);
- message.setContent(InputStream.class, null);
- } else {
- reader = message.getContent(XMLStreamReader.class);
- }
+ XMLStreamReader reader = message.getContent(XMLStreamReader.class);
if (reader == null) {
- return;
+ InputStream is = message.getContent(InputStream.class);
+ if (is != null) {
+ reader = StaxUtils.createXMLStreamReader(is);
+ message.setContent(InputStream.class, null);
+ }
+ if (reader == null) {
+ return;
+ }
}
DepthRestrictingStreamReader dr =
new DepthRestrictingStreamReader(reader,
Modified: thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/jaxb/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/jaxb/pom.xml 2013-04-04 15:01:17 UTC
(rev 17443)
+++ thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/jaxb/pom.xml 2013-04-04 16:13:36 UTC
(rev 17444)
@@ -145,12 +145,6 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-activation_1.1_spec</artifactId>
</dependency>
-
- <dependency>
- <groupId>${cxf.stax.impl.groupId}</groupId>
- <artifactId>${cxf.stax.impl.artifactId}</artifactId>
- </dependency>
-
</dependencies>
</profile>
</profiles>
Modified: thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/sdo/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/sdo/pom.xml 2013-04-04 15:01:17 UTC
(rev 17443)
+++ thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/sdo/pom.xml 2013-04-04 16:13:36 UTC
(rev 17444)
@@ -68,10 +68,6 @@
<artifactId>cxf-rt-core</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${cxf.stax.impl.groupId}</groupId>
- <artifactId>${cxf.stax.impl.artifactId}</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
Modified: thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/xmlbeans/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/xmlbeans/pom.xml 2013-04-04 15:01:17
UTC (rev 17443)
+++ thirdparty/cxf/branches/cxf-2.6.6/rt/databinding/xmlbeans/pom.xml 2013-04-04 16:13:36
UTC (rev 17444)
@@ -193,10 +193,6 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</dependency>
- <dependency>
- <groupId>${cxf.stax.impl.groupId}</groupId>
- <artifactId>${cxf.stax.impl.artifactId}</artifactId>
- </dependency>
</dependencies>
</profile>
<profile>
Modified: thirdparty/cxf/branches/cxf-2.6.6/tools/corba/pom.xml
===================================================================
--- thirdparty/cxf/branches/cxf-2.6.6/tools/corba/pom.xml 2013-04-04 15:01:17 UTC (rev
17443)
+++ thirdparty/cxf/branches/cxf-2.6.6/tools/corba/pom.xml 2013-04-04 16:13:36 UTC (rev
17444)
@@ -69,10 +69,6 @@
<artifactId>xmlschema-core</artifactId>
</dependency>
<dependency>
- <groupId>${cxf.stax.impl.groupId}</groupId>
- <artifactId>${cxf.stax.impl.artifactId}</artifactId>
- </dependency>
- <dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>