当前位置:编程学习 > JAVA >>

【】org.apache.axis2.AxisFault: Broken pipe问题

各位大侠,请教个问题,本人使用axis2(版本1.4.1)来开发webservice,其中客户端编写如下:

public String sendBossXml(String sendXml, String invokeMethod) {
String retXml = "";
log.info("sendXml:\n"+sendXml);
RPCServiceClient serviceClient = null; // 使用RPC方式调用WebService

try {

serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(v_url); // 指定调用WebService的URL
options.setTo(targetEPR);
options.setTimeOutInMilliSeconds(new Long(5000));//设置超时时间5秒

Class[] classes = new Class[] { String.class }; // 指定方法返回值的数据类型的Class对象

Object[] opAddEntryArgs = new Object[] { sendXml }; // 指定方法的参数值
QName opAddEntry = new QName(v_spaceName, invokeMethod); // 指定要调用的getGreeting方法及WSDL文件的命名空间

// 调用方法并输出该方法的返回值
retXml = (String) serviceClient.invokeBlocking(opAddEntry,
opAddEntryArgs, classes)[0];

log.info("retXml:\n"+retXml);

} catch (AxisFault e) {
e.printStackTrace();

}finally{
try {
serviceClient.cleanup();
} catch (AxisFault e) {
e.printStackTrace();
}
}

return retXml;
}



public static StringBuffer readFile(String fileName) throws IOException {
StringBuffer stringBuffer = new StringBuffer();
BufferedReader bf = new BufferedReader(new FileReader(fileName));
String line = "";
while ((line = bf.readLine()) != null) {
stringBuffer.append(line);
stringBuffer.append("\n");
}
return stringBuffer;
}

public static void main(String[] args) {

BossService bs = new BossService();

try {

StringBuffer sendXml = readFile("C:\\Users\\Admin\\Desktop\\xml\\querySend.xml");
System.out.println("sendXml=\n" + sendXml);

String retXml = bs.sendBossXml(sendXml.toString(),
"GSMQueryService");

System.out.println("retXml=\n" + retXml);

} catch (IOException e) {
e.printStackTrace();
}
}

调用之后报如下错误:
[ERROR]:2012-11-26 18:07:23  -- Broken pipe
org.apache.axis2.AxisFault: Broken pipe
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:337)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:214)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:43)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2002)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1908)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: com.ctc.wstx.exc.WstxIOException: Broken pipe
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.flush(MTOMXMLStreamWriter.java:146)
at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:472)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
... 22 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:525)
at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:504)
at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
at weblogic.servlet.internal.CharsetChunkOutput.flush(CharsetChunkOutput.java:249)
at weblogic.servlet.internal.ChunkOutputWrapper.flush(ChunkOutputWrapper.java:164)
at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:113)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
... 25 more


请问如何解决?非常感谢。
补充:Java ,  Java EE
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,