CXF报错后,独立解决->unwinding now Response was of unexpected text/html ContentType.
来源:互联网 发布:淘宝定做衣服的店 编辑:程序博客网 时间:2024/06/11 13:37
我的一个cxf项目, 在修改了web.xml的url-pattern后,调用报错,如下:
2009-12-8 10:09:00 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
信息: Interceptor has thrown exception, unwinding now Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><LINK type="text/css" rel="stylesheet" href="/terminal/TermWebservice/?stylesheet=1"><meta http-equiv=content-type content="text/html; charset=UTF-8"><title>CXF - Service list</title></head><body><span class="heading">Available services:</span><br/><table cellpadding="1" cellspacing="1" border="1" width="100%"><tr><td><span class="porttypename">TermWebservice</span><ul><li>getTermXml</li><li>getTermList</li></ul></td><td><span class="field">Endpoint address:</span> <span class="value">http://localhost:8088/terminal/TermWebservice/TermWebservice</span><br/><span class="field">Wsdl:</span> <a href="http://localhost:8088/terminal/TermWebservice/TermWebservice?wsdl">{http://webservice.terminalmonitor.synjones.com/}TermWebserviceImplService</a><br/><span class="field">Target namespace:</span> <span class="value">http://webservice.terminalmonitor.synjones.com/</span></td></tr></table></body></html>
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><LINK type="text/css" rel="stylesheet" href="/terminal/TermWebservice/?stylesheet=1"><meta http-equiv=content-type content="text/html; charset=UTF-8"><title>CXF - Service list</title></head><body><span class="heading">Available services:</span><br/><table cellpadding="1" cellspacing="1" border="1" width="100%"><tr><td><span class="porttypename">TermWebservice</span><ul><li>getTermXml</li><li>getTermList</li></ul></td><td><span class="field">Endpoint address:</span> <span class="value">http://localhost:8088/terminal/TermWebservice/TermWebservice</span><br/><span class="field">Wsdl:</span> <a href="http://localhost:8088/terminal/TermWebservice/TermWebservice?wsdl">{http://webservice.terminalmonitor.synjones.com/}TermWebserviceImplService</a><br/><span class="field">Target namespace:</span> <span class="value">http://webservice.terminalmonitor.synjones.com/</span></td></tr></table></body></html>
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
at $Proxy43.getTermList(Unknown Source)
at com.synjones.terminalmonitor.webservice.client.Client.main(Client.java:26)
Caused by: org.apache.cxf.interceptor.Fault: Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><LINK type="text/css" rel="stylesheet" href="/terminal/TermWebservice/?stylesheet=1"><meta http-equiv=content-type content="text/html; charset=UTF-8"><title>CXF - Service list</title></head><body><span class="heading">Available services:</span><br/><table cellpadding="1" cellspacing="1" border="1" width="100%"><tr><td><span class="porttypename">TermWebservice</span><ul><li>getTermXml</li><li>getTermList</li></ul></td><td><span class="field">Endpoint address:</span> <span class="value">http://localhost:8088/terminal/TermWebservice/TermWebservice</span><br/><span class="field">Wsdl:</span> <a href="http://localhost:8088/terminal/TermWebservice/TermWebservice?wsdl">{http://webservice.terminalmonitor.synjones.com/}TermWebserviceImplService</a><br/><span class="field">Target namespace:</span> <span class="value">http://webservice.terminalmonitor.synjones.com/</span></td></tr></table></body></html>
at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:73)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:641)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2102)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1980)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1905)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:600)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:469)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
... 2 more
主要是本人对错误描述不得要领, google一下关键信息: Interceptor has thrown exception, unwinding now Response was of unexpected text/html ContentType. 但是没有找到满意答案, 后来一看,提示的信息里有http://localhost:8088/terminal/TermWebservice/TermWebservice?wsdl, 这个url比我配置的多了一个TermWebservice
就是我刚刚多配置的web.xml的url-pattern,为<url-pattern>/TermWebservice/*</url-pattern>, 了以前是<url-pattern>/*</url-pattern> 的, 所以问题找到了, 是url要多加一个TermWebservice,
所以在调用的client端,加上TermWebservice这样在调用就可以了, 因为错误比较误导人,而网上查询有没有, 希望能帮到有同样错误的兄弟。
- CXF报错后,独立解决->unwinding now Response was of unexpected text/html ContentType.
- HTML Response ContentType 大全
- response.ContentType ="text/plain";
- unwinding now org.apache.cxf.interceptor.Fault: Index: 1, Size: 1
- illegal to have multiple occurrences of contentType with different values (old: text/html; charset=
- client found response content type of text/html charset=utf-8 but expected text/xml
- Response.ContentType
- response.contenttype
- Response.ContentType
- Response.ContentType
- Response.ContentType
- cxf Unexpected wrapper element异常解决
- cxf Unexpected wrapper element异常解决
- HTML ContentType
- ContentType(html)
- Response.ContentType 所有类型
- Response.ContentType 类型大全
- Response.ContentType 所有类型
- 如何做好软件估计?
- SQL Server Samples : SQL Server 2008 Samples
- SQLite随机取n行数据
- 第22章 文本组件
- 全功能点估算方法简介
- CXF报错后,独立解决->unwinding now Response was of unexpected text/html ContentType.
- 数据结构-C++描述:数据描述引言
- SortedList泛型类
- 软件项目的工作量估算方法
- linux(ubuntu)卸载,已解决
- 七种场景下的软件工作量估算步骤
- [软件调试----读书笔记]完整的软件调试过程
- 使用RMAN恢复用户DML误操作的步骤
- Linux系统中查看目录空间的命令