Support attributes longer than 512kb.

This commit is contained in:
James Agnew 2015-06-04 12:19:10 -04:00
parent 9b97fb0e97
commit 62b0707b36
6 changed files with 11 additions and 5 deletions

View File

@ -221,6 +221,7 @@ public class XmlUtil {
if (inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory) {
// inputFactory.setProperty(WstxInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
inputFactory.setProperty(WstxInputProperties.P_UNDECLARED_ENTITY_RESOLVER, XML_RESOLVER);
inputFactory.setProperty(WstxInputProperties.P_MAX_ATTRIBUTE_SIZE, "100000000");
}
} catch (ClassNotFoundException e) {
ourLog.debug("WstxOutputFactory (Woodstox) not found on classpath");

View File

@ -958,7 +958,7 @@ public class ResourceProviderDstu2Test {
}
}
// @Test
@Test
public void testValidateResourceHuge() throws IOException {
Patient patient = new Patient();

View File

@ -118,7 +118,7 @@ public class XmlParserTest {
}
// @Test
@Test
public void testParseAndEncodeHugeValue() {
int len = 1000000;
byte[] bytes = new byte[len];
@ -137,7 +137,7 @@ public class XmlParserTest {
obs = ourCtx.newXmlParser().parseResource(Observation.class, str);
att = (AttachmentDt) obs.getValue();
assertEquals(bytes, att.getData().getValue());
assertArrayEquals(bytes, att.getData().getValue());
}

View File

@ -66,7 +66,7 @@ public class ResourceValidatorDstu2Test {
ourLog.info(resultString);
assertEquals(2, result.getOperationOutcome().getIssue().size());
assertThat(resultString, StringContains.containsString("'2000-15-31'"));
assertThat(resultString, StringContains.containsString("2000-15-31"));
}
@SuppressWarnings("deprecation")

File diff suppressed because one or more lines are too long

View File

@ -58,6 +58,12 @@
<action type="add">
LoggingInterceptor for server now supports logging DSTU2 extended operations by name
</action>
<action type="fix">
Woodstox XML parser has a default setting to limit the maximum
length of an attribute to 512kb. This caused issues handling
large attachments, so this setting has been increased to 100Mb.
Thanks to Nikos Kyriakoulakos for reporting!
</action>
</release>
<release version="1.0" date="2015-May-8">
<action type="add">