org.apache.cxf.interceptor.Fault:无法发送消息。产生java.io.IOException:由造成IOException异常调用服务:验证失败

问题描述 投票:0回答:1

我收到以下错误,当我尝试调用我的服务

WARNING: Interceptor for {http://schemas.microsoft.com/dynamics/2008/01/services}CustomerService#{http://schemas.microsoft.com/dynamics/2008/01/services}read has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:535)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:465)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:368)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:321)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
    at $Proxy32.read(Unknown Source)
    at com.attunix.axclientcxf.AXTestCustomerService.ReadCustomer(AXTestCustomerService.java:210)
    at com.attunix.axclientcxf.AXTestCustomerService.Read(AXTestCustomerService.java:105)
    at com.attunix.axclientcxf.AXTestCustomerService.Read(AXTestCustomerService.java:116)
    at com.attunix.axclientcxf.TestAXClientCXF.Read(TestAXClientCXF.java:94)
    at com.attunix.axclientcxf.TestAXClientCXF.main(TestAXClientCXF.java:74)
Caused by: java.io.IOException: IOException invoking http://daxuataif1.int.fusionio.com/MicrosoftDynamicsAXAif50/customerservice.svc: Authentication failure
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1431)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1416)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    ... 13 more
Caused by: java.io.IOException: Authentication failure
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1296)

我验证用户名和密码,他们似乎是正确的。我无言以对为什么它返回一个身份验证失败。任何线索将是helpful.Thanks。

java cxf
1个回答
0
投票

检查超时是不够的连接。将其设置为0。

HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setReceiveTimeout(0);
//and or 
policy.setConnectionTimeout(0);
© www.soinside.com 2019 - 2024. All rights reserved.