java saaj异常

发布于 2024-12-10 08:42:01 字数 3056 浏览 0 评论 0原文

我尝试使用 String 创建 Soap Envelope

SOAPPart().setContent(Source).

我尝试从同一条消息中获取 SOAPBody,但它抛出异常

SEVERE: SAAJ0511: Unable to create envelope from given source
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70)
    at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
    at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1253)
    at mytransactions.Test.main(Test.java:107)
Caused by: javax.xml.transform.TransformerException: XML-22103: (Fatal Error) DOMResult can not be this kind of node.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:353)
    at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393)
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
    ... 4 more

CAUSE:

javax.xml.transform.TransformerException: XML-22103: (Fatal Error) DOMResult can not be this kind of node.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:353)
    at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393)
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70)
    at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
    at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1253)
    at mytransactions.Test.main(Test.java:107)

CAUSE:

javax.xml.transform.TransformerException: XML-22103: (Fatal Error) DOMResult can not be this kind of node.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:353)
    at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393)
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70)
    at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
    at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1253)
    at mytransactions.Test.main(Test.java:107)

如何解决此问题?

I try to create a Soap Envelope from String using

SOAPPart().setContent(Source).

And I try to get the SOAPBody from same message, but its throwing exception

SEVERE: SAAJ0511: Unable to create envelope from given source
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70)
    at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
    at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1253)
    at mytransactions.Test.main(Test.java:107)
Caused by: javax.xml.transform.TransformerException: XML-22103: (Fatal Error) DOMResult can not be this kind of node.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:353)
    at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393)
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
    ... 4 more

CAUSE:

javax.xml.transform.TransformerException: XML-22103: (Fatal Error) DOMResult can not be this kind of node.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:353)
    at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393)
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70)
    at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
    at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1253)
    at mytransactions.Test.main(Test.java:107)

CAUSE:

javax.xml.transform.TransformerException: XML-22103: (Fatal Error) DOMResult can not be this kind of node.
    at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:883)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:353)
    at com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:393)
    at com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:70)
    at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:122)
    at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1253)
    at mytransactions.Test.main(Test.java:107)

How to fix this?

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

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

发布评论

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

评论(1

被你宠の有点坏 2024-12-17 08:42:01

服务 API 将在运行时可用的 jar 中的 META-INF/services/javax.xml.transform.TransformerFactory 文件中查找类名。我使用 jvm -D 选项覆盖此属性。

The Services API will look for a classname in the file META-INF/services/javax.xml.transform.TransformerFactory in jars available to the runtime. I override this property using jvm -D option.

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