gpt4 book ai didi

java saaj 异常

转载 作者:行者123 更新时间:2023-11-29 09:18:50 24 4
gpt4 key购买 nike

我尝试使用

从 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)

如何解决这个问题?

最佳答案

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

关于java saaj 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7794308/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com