我是用java写的webservice,但是在远程被调用的时候webservice出现异常,异常内容为:2009-4-28 16:53:01 com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle
严重: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:292)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:106)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:91)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:575)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:547)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sun.xml.ws.streaming.XMLReaderException: Unable to create StAX reader or writer
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Zephyr.doCreate(XMLStreamReaderFactory.java:330)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.doCreate(XMLStreamReaderFactory.java:195)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:148)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:294)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
... 15 more
Caused by: javax.xml.stream.XMLStreamException
at com.sun.xml.stream.XMLReaderImpl.setInputSource(XMLReaderImpl.java:197)
at com.sun.xml.stream.XMLReaderImpl.<init>(XMLReaderImpl.java:180)
at com.sun.xml.stream.ZephyrParserFactory.getXMLStreamReaderImpl(ZephyrParserFactory.java:286)
at com.sun.xml.stream.ZephyrParserFactory.createXMLStreamReader(ZephyrParserFactory.java:135)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Zephyr.doCreate(XMLStreamReaderFactory.java:314)
... 20 more
>>>>>9167
2009-4-28 16:54:04 com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit handle
严重: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:292)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:106)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:91)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:575)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:547)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sun.xml.ws.streaming.XMLReaderException: Unable to create StAX reader or writer
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Zephyr.doCreate(XMLStreamReaderFactory.java:330)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.doCreate(XMLStreamReaderFactory.java:195)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:148)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:294)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
... 15 more
Caused by: javax.xml.stream.XMLStreamException
at com.sun.xml.stream.XMLReaderImpl.setInputSource(XMLReaderImpl.java:197)
at com.sun.xml.stream.XMLReaderImpl.<init>(XMLReaderImpl.java:180)
at com.sun.xml.stream.ZephyrParserFactory.getXMLStreamReaderImpl(ZephyrParserFactory.java:286)
at com.sun.xml.stream.ZephyrParserFactory.createXMLStreamReader(ZephyrParserFactory.java:135)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Zephyr.doCreate(XMLStreamReaderFactory.java:314)
... 20 more
不知道这个是什么原因造成的?
下面是我的webservice的代码:
package cn.sh.luheng.flyprepare.service.manage;import java.sql.SQLException;
import java.util.List;import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;import cn.sh.luheng.flyprepare.dao.foc.FocDAO;
import cn.sh.luheng.flyprepare.dao.sign.FlightInfoDAO;
import cn.sh.luheng.flyprepare.dao.sign.po.AirmanInfo;
import cn.sh.luheng.flyprepare.dao.sign.po.FlightInfo;
import cn.sh.luheng.flyprepare.service.IService;
import cn.sh.luheng.flyprepare.service.prepare.SignPageService;@WebService(targetNamespace = "http://www.luheng.sh.cn/shprepare")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class AirmanSignService implements IService { private FocDAO focDao; private FlightInfoDAO flightDao; private SignPageService signPageService; public void setFlightDao(FlightInfoDAO flightDao) {
this.flightDao = flightDao;
} public void setFocDao(FocDAO focDao) {
this.focDao = focDao;
} public void setSignPageService(SignPageService signPageService) {
this.signPageService = signPageService;
} public boolean addFlightInfo(String date) {
try {
List<FlightInfo> flifghtArray = this.focDao.getDayFlight(date);
for (int i = 0; i < flifghtArray.size(); i++) {
FlightInfo flight = flifghtArray.get(i);
this.flightDao.save(flight);
}
} catch (SQLException e) {
e.printStackTrace();
return false;
} return true;
} @WebMethod(action = "AirmanSign", operationName = "AirmanSign", exclude = false)
@WebResult(name = "AirmanInfo")
public AirmanInfo airmanSign(@WebParam(name = "airmanId") String id) {
return signPageService.signAirmanInfo(id);
}

@WebMethod(action ="AircrewInfo", operationName = "AircrewInfo", exclude = false)
@WebResult(name = "FlightInfo")
public FlightInfo aircrewInfo(@WebParam(name = "flightInfoId") int id) {
return flightDao.findById(id);
}
}