java 轴:faultString:org.xml.sax.SAXParseException:文件过早结束
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1527727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Axis: faultString: org.xml.sax.SAXParseException: Premature end of file
提问by Abdul Khaliq
I have deployed a webservice using servletexec configured with IIS and i can successfully access webservice using anonymous account. But when I enable Windows Integrated Authentication I am getting following error.
我已经使用配置了 IIS 的 servletexec 部署了一个网络服务,我可以使用匿名帐户成功访问网络服务。但是当我启用 Windows 集成身份验证时,我收到以下错误。
- ntlm authentication scheme selected
- Discarding unexpected response: HTTP/1.1 100 Continue
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:akvm
org.xml.sax.SAXParseException: Premature end of file.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
回答by beny23
It looks like that the Axis client does not like the NTLM authentication challenge. See error message at the top:
看起来 Axis 客户端不喜欢 NTLM 身份验证质询。请参阅顶部的错误消息:
Discarding unexpected response: HTTP/1.1 100 Continue
After which there is no XML for Axis to parse, which is why you're getting premature end of file.
之后就没有可供 Axis 解析的 XML,这就是为什么您会过早地结束文件。
In order to use NTLM with Axis (1.4), you'll have to use the CommonsHTTPSenderinstead of the standard transport:
为了将 NTLM 与 Axis (1.4) 一起使用,您必须使用CommonsHTTPSender代替标准传输:
<transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender">
</transport>
in your client-config.wsddand then set up the NTLM username and password through the Stubobject.
在你client-config.wsdd然后通过Stub对象设置NTLM用户名和密码。
回答by Steen
The "premature end of file" type errors from the xerces SAX implementation usually indicates that the SAX parser expected data, but got none (not null, but an initialized empty InputSource). From the stack trace, it looks as if the axis SOAP handler expects a SOAP xml message to arrive, but the message is empty. My knowledge of ISS and its infrastructure is close to nil, can you get any log messages from the server?
来自 xerces SAX 实现的“文件过早结束”类型错误通常表明 SAX 解析器需要数据,但没有得到任何数据(不是null,而是初始化的空InputSource)。从堆栈跟踪来看,轴 SOAP 处理程序似乎期望 SOAP xml 消息到达,但该消息是空的。我对 ISS 及其基础设施的了解几乎为零,您能从服务器获取任何日志消息吗?

