客户端日志信息如下:
17.10.2011 23:29:08 ERROR Thread-5 rootLogger - org.apache.cxf.binding.soap.SoapFault: Could not create XMLStreamReader (input was of encoding UTF-8).
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:185)
at $Proxy43.isConnected(Unknown Source)
at cn.edu.hust.mes.webservice.CallWebServices.isConnected(CallWebServices.java:241)
at cn.edu.hust.mes.opcapp.MESThread.run(MESThread.java:58)17.10.2011 23:29:52 ERROR Thread-5 rootLogger - org.apache.cxf.binding.soap.SoapFault: Could not create XMLStreamReader (input was of encoding UTF-8).
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:185)
at $Proxy43.isConnected(Unknown Source)
at cn.edu.hust.mes.webservice.CallWebServices.isConnected(CallWebServices.java:241)
at cn.edu.hust.mes.opcapp.MESThread.run(MESThread.java:58)17.10.2011 23:30:16 ERROR Thread-5 rootLogger - org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:185)
at $Proxy43.isConnected(Unknown Source)
at cn.edu.hust.mes.webservice.CallWebServices.isConnected(CallWebServices.java:241)
at cn.edu.hust.mes.opcapp.MESThread.run(MESThread.java:58)
Caused by: java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1937)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1865)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
... 3 more
这是什么原因啊?系统运行期间,偶尔会报这个错。

解决方案 »

  1.   

    问题补充:
    客户端部分代码:
    MESThread 类:
    public void run() {
    isrunning = true;
    myLogger.logMessagePrint("MES Thread run");
    while (true) {
    isrunning = true;
    try {
    sleep(3000);// 休息3秒钟
    if("ok".equalsIgnoreCase(cwbs.isConnected()))
    opcUI.setBarString("Server working...");
    else{
    opcUI.setBarString("MES不能连接,正在尝试连接...");
    continue;
    }
    if (!isrunning)
    break;// 如果关闭则结束服务
    String[][] zoneinfo = db.getDatazoneinfo();
    try { cwbs.updateZoneInfo(convetZoneinfoArraytoString(zoneinfo));
    } catch (Exception e) {
    myLogger.exceptionPrintDebug(e);
    }
    sleep(2000);// 休息2秒钟
    // 上传涂装的时间
    ResultSet rs = db.getTzTime();
    try {
    while (rs != null && rs.next()) {
    String slingid = rs.getString(1);
    String time = rs.getString(2);
    int in_out = rs.getInt(3);
    if(cwbs.uploadTZTime(slingid, time, in_out).equalsIgnoreCase("ok"))
    db.deleteTZTimeline(time);
            sleep(1000);
    }
    } catch (SQLException e1) {
    e1.printStackTrace();
    }catch (Exception e) {
    myLogger.exceptionPrintDebug(e);
    }                                                                  
    //上传天窗的时间
    rs=db.getTcTime();
    try {
    while(rs!=null&&rs.next())
    {
    String slingid=rs.getString(1);
    String time = rs.getString(2);
    int in_out = rs.getInt(3);
    String oldSling=rs.getString(4);
    try {
    if(cwbs.uploadTCTime(slingid, time, in_out, oldSling).equalsIgnoreCase("ok")) db.deleteTCTimeline(time);
    } catch (Exception e) {
    myLogger.exceptionPrintDebug(e);
    }
    sleep(1000);
    }
    } catch (SQLException e) {
    myLogger.exceptionPrintDebug(e);
    } rs=db.getOffTime();
    try {
    while(rs!=null&&rs.next())
    {
    String slingid=rs.getString(1);
    String time = rs.getString(2);
    int op_code = rs.getInt(3);
    try {
    if(cwbs.uploadOffTime(slingid, time, op_code).equalsIgnoreCase("ok"))
    db.deleteOFFTimeline(time);
    } catch (Exception e) {
    myLogger.exceptionPrintDebug(e);
    }
    sleep(1000);
    }
    } catch (SQLException e) {
    myLogger.exceptionPrintDebug(e);
    }
    } catch (InterruptedException e) {
    myLogger.exceptionPrintDebug(e);
    continue;
    }
    while (!PlcDBRead.isPLCruning()) {
    try {
    sleep(2000);// 如果PLC不能通讯,该线程休息2秒钟,继续检测
    myLogger.logMessagePrint("由于OPC中断而停止MESthread");
    } catch (InterruptedException e) {
    myLogger.exceptionPrintDebug(e);
    }
    }
    }
    }CallWebServices类:
    public String isConnected()
    {
    PbsPlcListenerServer Client = (PbsPlcListenerServer)context.getBean("upDateCarInfoClient");
    try {
    return Client.isConnected();
    } catch (Exception e) {
    myLogger.exceptionPrintDebug(e);
    }
    return "";
    }
    服务器端代码:
    public String isConnected() 
    {
    Logger.debug(this, "Test Connection..."+new Date());
    //不开事务
    return success;
    }