Xerces jar 是 DOM 解析器或 SAX 解析器

发布于 2024-12-27 03:45:51 字数 1322 浏览 1 评论 0原文

我想了解 Xerces.jar 的实现 Xerces.jar 是 DOM 解析器还是 SAX 解析器。 当我尝试读取一个巨大的 XML 文件时,我收到以下错误消息。请帮忙 java.lang.StackOverflowError 错误

at org.apache.xerces.dom.ParentNode.readObject(Unknown Source)

at sun.reflect.GeneratedMethodAccessor569.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:618)

at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1098)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1756)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1948)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1756)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1948)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1756)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)

I would like to know about Xerces.jar implementation
is Xerces.jar a DOM parser or SAX parser.
When I try reading a huge XML file I am getting the following error message. Please help
java.lang.StackOverflowError

at org.apache.xerces.dom.ParentNode.readObject(Unknown Source)

at sun.reflect.GeneratedMethodAccessor569.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:618)

at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1098)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1756)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1948)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1756)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1948)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1756)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1342)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人心善变 2025-01-03 03:45:51

两个都。

这是甜点配料和地板蜡:)

PS:
请张贴堆栈中实际发生异常的空间。你似乎把它遗漏了:)

PPS:
另请参阅此处:

由于解析器构建内容模型的方式
内容复杂的元素,为
minOccurs 或 maxOccurs 属性可能会导致解析器抛出
堆栈溢出错误。应避免使用较大的 minOccurs 值,并且
应使用无界值而不是 maxOccurs 的较大值。

考虑关闭架构检查,或更改 minOccurs/maxOccurs:

Both.

It's a dessert topping AND a floor wax :)

PS:
Please post the space in the stack where the exception actually occurred. You seem to have left it out :)

PPS:
Also look here:

Due to the way in which the parser constructs content models for
elements with complex content, specifying large values for the
minOccurs or maxOccurs attributes may cause the parser to throw a
StackOverflowError. Large values for minOccurs should be avoided, and
unbounded should be used instead of a large value for maxOccurs.

Consider turning schema checking OFF, or changing minOccurs/maxOccurs:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文