English 中文(简体)
JAX-WS 2.1-为什么我在尝试处理我的第一个web服务请求时会收到MessageCreationException?
原标题:JAX-WS 2.1 - Why do I get a MessageCreationException while trying to process my first web service request?

我使用的是JAX-WS 2.1,并通过Netbeans 6.0中的开发工具使用JAX-WS构建了一个web服务。看起来一切都是正确构建和启动的,但在重新启动Tomcat后的第一个web服务请求中,我得到了以下异常:

SEVERE: 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:365) at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277) 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:457) at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244) at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135) at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129) at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160) at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:619)

我想有人以前见过这个错误,有人能告诉我我做错了什么吗?为什么我只在最初的web服务请求中得到它?

Soap请求:

<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="ws.companynamehere.com/xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns2="ws.companynamehere.com/xsd">
<soapenv:Header/>
<soapenv:Body>
    <ns2:Pickup>
        <contact>
            <company>DEMO COMPANY</company> 
            <name>DEMO COMPANY</name> 
            <phone>1111111111</phone> 
            <email>test@test.com</email> 
        </contact>
        <shipper>
            <shipperName>DEMO</shipperName>
            <address>123 TEST AVE</address> 
            <city>SOMEWHERE</city> 
            <state>SC</state> 
            <zip>99999</zip> 
            <pickupContactName>Test</pickupContactName> 
            <phone>9999999999</phone> 
            <email>test@test.com</email> 
            <email2 /> 
            <email3 /> 
            <fax  /> 
            <requestPickupDate>20101008</requestPickupDate> 
            <requestPickupTime>1200</requestPickupTime>  
        </shipper>
        <consignees>
            <Consignee>
                <name>TEST</name> 
                <destZip>99999</destZip> 
                <weight>1234</weight> 
                <pieces>1</pieces> 
                <pkgType>PL</pkgType> 
            </Consignee>
        </consignees>
    </ns2:Pickup>
</soapenv:Body>
</soapenv:Envelope>

肥皂响应(仅限第一次尝试):

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
         <faultcode>S:Client</faultcode>
         <faultstring>Couldn t create SOAP message due to exception: Unable to create StAX reader or writer</faultstring>
      </S:Fault>
   </S:Body>
</S:Envelope>
问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签