Stackoverflow用于巨大的xml

时间:2017-02-17 06:04:03

标签: java xml web-services

在我的网络服务中,当我尝试使用大量内容运行XML时,我遇到了错误。

输入是基于SOAP的Web服务。在任何处理开始之前出现此错误。服务器我正在运行我的应用程序是weblogic 12.1.3. Java版本1.7。

我不知道如何解决此错误,因为我需要启用我的服务才能接受大型XML内容

java.lang.StackOverflowError
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1700)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2908)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2791)
        at com.sun.xml.stream.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2932)

2 个答案:

答案 0 :(得分:0)

有基于流的XML解析器。如果您可以在Web服务(框架)中操作解析,则可以使用它们。

看看StAX

答案 1 :(得分:0)

表示stackoverflow错误:这是因为在EAP lib中添加了旧的webservice-rt.jar。我错误地查看了堆栈跟踪,发现这些类都来自它。删除了罐子,它解决了它。 对于unkonwn JAXBcontent我试图在各种博客上寻找答案,但找不到答案。然后我反编译罐子,发现下面有助于解决这个错误。由于JDK和weblogic中具有不同版本的类,因此出现错误。

-Djavax.xml.bind.JAXBContext = com.sun.xml.bind.v2.ContextFactory