Java-WS UnsupportedEncodingException

时间:2012-04-15 03:12:42

标签: java web-services jboss jax-ws

当我尝试使用在JBoss 4.0.2上运行的Web服务时,它会返回以下错误

org.apache.axis2.AxisFault: java.io.UnsupportedEncodingException: utf-8,text/xml
    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:330)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:213)
    at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:530)
    at org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:414)
    at org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:377)
    at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:165)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    ...
Caused by: javax.xml.stream.XMLStreamException: java.io.UnsupportedEncodingException: utf-8,text/xml
    at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:257)
    at com.ctc.wstx.stax.WstxOutputFactory.createXMLStreamWriter(WstxOutputFactory.java:124)
    at org.apache.axiom.om.util.StAXUtils$5.run(StAXUtils.java:252)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:248)
    at org.apache.axiom.om.impl.MTOMXMLStreamWriter.<init>(MTOMXMLStreamWriter.java:94)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:470)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
    ... 30 more
Caused by: java.io.UnsupportedEncodingException: utf-8,text/xml
    at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:42)
    at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:83)
    at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:253)

搜索周围,似乎是JAX-WS的一个问题。以下是一些支持此结论的错误报告

很难说JBoss包含哪个版本的JAX-WS,因为它实际上是AXIS2软件包的一部分,但我最好的猜测是版本1.4。有没有针对JBoss这个问题的解决方法,还是需要不同版本的JAX-WS?我对JBoss并不熟悉,所以我不知道是否可以用更新的版本换掉JAR。

0 个答案:

没有答案