jaxp

java append to file

♀尐吖头ヾ 提交于 2019-11-28 09:16:22
问题 I googled for this for a while but can't seem to find it and it should be easy. I want to append a CR to then end of an XML file that I am creating with a Transformer. Is there a way to do this> I tried the following but this resulted in a blank file? Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "file:///ReportWiz.dtd"); xformer.transform(source, result); OutputStream writer = new FileOutputStream(file); Byte b =

What's causing these ParseError exceptions when reading off an AWS SQS queue in my Storm cluster

核能气质少年 提交于 2019-11-27 19:45:12
I'm using Storm 0.8.1 to read incoming messages off an Amazon SQS queue and am getting consistent exceptions when doing so: 2013-12-02 02:21:38 executor [ERROR] java.lang.RuntimeException: com.amazonaws.AmazonClientException: Unable to unmarshall response (ParseError at [row,col]:[1,1] Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.) at REDACTED.spouts.SqsQueueSpout.handleNextTuple(SqsQueueSpout.java:219) at REDACTED.spouts.SqsQueueSpout.nextTuple(SqsQueueSpout.java:88) at backtype.storm.daemon

Java XPath (Apache JAXP implementation) performance

两盒软妹~` 提交于 2019-11-26 23:49:56
NOTE: If you experience this issue as well, please upvote it on Apache JIRA: https://issues.apache.org/jira/browse/XALANJ-2540 I have come to an astonishing conclusion that this: Element e = (Element) document.getElementsByTagName("SomeElementName").item(0); String result = ((Element) e).getTextContent(); Seems to be an incredible 100x faster than this: // Accounts for 30%, can be cached XPathFactory factory = XPathFactory.newInstance(); // Negligible XPath xpath = factory.newXPath(); // Negligible XPathExpression expression = xpath.compile("//SomeElementName"); // Accounts for 70% String

What's causing these ParseError exceptions when reading off an AWS SQS queue in my Storm cluster

风格不统一 提交于 2019-11-26 22:50:30
问题 I'm using Storm 0.8.1 to read incoming messages off an Amazon SQS queue and am getting consistent exceptions when doing so: 2013-12-02 02:21:38 executor [ERROR] java.lang.RuntimeException: com.amazonaws.AmazonClientException: Unable to unmarshall response (ParseError at [row,col]:[1,1] Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.) at REDACTED.spouts.SqsQueueSpout.handleNextTuple(SqsQueueSpout.java

How do I find out which JAXP implementation is in use and where it was loaded from?

淺唱寂寞╮ 提交于 2019-11-26 15:25:27
问题 I would like to provide diagnostic information about what JAXP implementation is in use, and which JAR file it was loaded from. One way to achieve this is to create in instance of, for example, a DocumentBuilderFactory , and then inspect the properties of that class: private static String GetJaxpImplementation() { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); Class<? extends DocumentBuilderFactory> c = documentBuilderFactory.getClass(); Package p = c

Java XPath (Apache JAXP implementation) performance

与世无争的帅哥 提交于 2019-11-26 08:48:26
问题 NOTE: If you experience this issue as well, please upvote it on Apache JIRA: https://issues.apache.org/jira/browse/XALANJ-2540 I have come to an astonishing conclusion that this: Element e = (Element) document.getElementsByTagName(\"SomeElementName\").item(0); String result = ((Element) e).getTextContent(); Seems to be an incredible 100x faster than this: // Accounts for 30%, can be cached XPathFactory factory = XPathFactory.newInstance(); // Negligible XPath xpath = factory.newXPath(); //