xerces

WAS 8.5: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers.SAXParserFactory

眉间皱痕 提交于 2019-12-05 08:21:42
I am deploying a J2EE web application in Websphere Application Server 8.5. The web application has a shared library with all the third party libraries. All the internally coded libraries are inside the WEB-INF/lib folder. The problem is that in only some jsps WAS it is throwing the following exception. I think it is related with xercesImpl-2.8.1.jar but I don't understand why it is throwing this exception and why it is throwing in only some pages. In tomcat it is working perfectly. java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers

xerces serialization in Java 6

断了今生、忘了曾经 提交于 2019-12-05 08:12:47
In Java 6, the entire xerces XML parser/serializer implementation is now in the Java runtime (rt.jar). The packages have been moved under the com.sun.* namespace, which places them off-limits for explicit reference within client code. This is not a problem when using the parser, which is instantiated via javax API-defined factories. However, our code also uses xerces serialization (org.apache.xml.serialize.* ). AFAICT, there are no javax.xml API-defined factories for creating instances of Serializer and OutputFormat. This seems to imply that the only way to get one is to explicitly call the

Why is Apache Xerces/Xalan adding additional carriage returns to my serialized output?

[亡魂溺海] 提交于 2019-12-05 04:34:11
I'm using Apache Xerces 2.11.0 and Apache Xalan 2.7.1 and I'm having problems with additional carriage return characters in the serialized XML. I have this (pseudo) code: String myString = ...; Document doc = ...; Element item = doc.createElement("item"); item.appendChild(doc.createCDATASection(myString)); Transformer transformer = ...; ByteArrayOutputStream stream = new ByteArrayOutputStream(); Result result = new StreamResult(stream); transformer.transform(new DOMSource(document), result); Now myString contains line breaks ( \r\n ), (actually it's base64 encoded data) but when I look at the

Apache Hadoop setXIncludeAware UnsupportedOperationException

人走茶凉 提交于 2019-12-05 01:57:17
I'm trying to get Apache Hadoop 1.21 running, but I'm getting this exception: Failed to set setXIncludeAware(true) for parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@2662e5cf:java.lang.UnsupportedOperationException full stack trace: 13/10/17 17:22:52 ERROR conf.Configuration: Failed to set setXIncludeAware(true) for parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@2662e5cf:java.lang.UnsupportedOperationException: setXIncludeAware is not supported on this JAXP implementation or earlier: class org.apache.xerces.jaxp

Struts2 & Tiles: When apache.org is down my webapp fails to start

假如想象 提交于 2019-12-05 00:56:54
问题 I am building a Struts2 web application which uses tiles however I have discovered a quite frustrating problem where if apache.org is down (which seems to happen quite regularly) the web application fails to start. This is because in its standard setup the StrutsTilesListener tries to load the tiles defenitions file which includes a DOCTYPE with a public-id which points to a DTD located on tiles.apache.org. When the application starts up the definition file is loaded using Apache Xerces via

Workaround for XMLSchema not supporting maxOccurs larger than 5000

青春壹個敷衍的年華 提交于 2019-12-04 07:31:52
My problem is with parsing an XSD Schema that has elements with maxOccurs larger than 5000 (but not unbounded ). This is actually a know issue in either Xerces (which I'm using, version 2.9.1) or JAXP, as described here: http://bugs.sun.com/view_bug.do;jsessionid=85335466c2c1fc52f0245d20b2e?bug_id=4990915 I already know that if I changed the maxOccurs numbers in my XSD from numbers larger than 5000 to unbounded all works well. Sadly, this is not an option in my case (I cannot meddle with the XSD file). My question is: Does someone know some other workaround in Xerces for this issue? Or Can

Can't build app when I import Xerces library (exit value 1)

给你一囗甜甜゛ 提交于 2019-12-04 05:40:16
I cannot seem to get my app to build when I import in the Xerces library. I am already using the multidex due to previous issues and therefore I know this is all setup properly. I have spend a couple of days now looking online and trying all sorts of versions of Xerces and tweaks to my build.gradle but cannot work out the issue. I have tried cleaning re-building, re-setting Android Studio/my PC, using a jar directly compiling and now officially out of ideas. Below is my build.gradle setup: android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "#packageid#"

libxml2 from java

时间秒杀一切 提交于 2019-12-04 05:05:25
This question is somewhat related to Fastest XML parser for small, simple documents in Java but with a few more specifics. I'm working on an application which needs to parse many (10s of millions), small (approx. 300k) xml documents. The current implementation is using xerces-j and it takes about 2.5 ms per xml document on a 1.5 GHz machine. I'd like to improve this performance. I came across this article http://www.xml.com/pub/a/2007/05/16/xml-parser-benchmarks-part-2.html claiming that libxml2 can parse about an order of magnitude faster than any java parsers. I'm not sure if I believe it,

How do I turn off validation when parsing well-formed XML using DocumentBuilder.parse?

允我心安 提交于 2019-12-04 04:22:11
I'm using Java 6. I want to parse XHTML that I know is well-formed. As such, I don't want to do any validation against DTD's or other schemas referenced in the doc. However, I'm having trouble figuring out how to turn that validation off. I have DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); final DocumentBuilder b = factory.newDocumentBuilder(); final InputSource s = new InputSource(new StringReader(str)); org.w3c.dom.Document result = b.parse(s); But I still get an exception on the last line ... java.net.SocketException: Unexpected end of

XPath support in Xerces-C

久未见 提交于 2019-12-04 03:12:13
I am supporting a legacy C++ application which uses Xerces-C for XML parsing. I've been spoiled by .Net and am used to using XPath to select nodes from a DOM tree. Is there any way to get access some limited XPath functionality in Xerces-C? I'm looking for something like selectNodes("/for/bar/baz"). I could do this manually, but XPath is so nice by comparison. Matt See the xerces faq. http://xerces.apache.org/xerces-c/faq-other-2.html#faq-9 Does Xerces-C++ support XPath? No.Xerces-C++ 2.8.0 and Xerces-C++ 3.0.1 only have partial XPath implementation for the purposes of handling Schema identity